title: be64toh not linking or being declared when compiling with -std=c99
body: <p>When I compile the following program (the code for all the defines I've gotten from <a href="https://stackoverflow.com/questions/809902/64-bit-ntohl-in-c/4410728#4410728">64 bit ntohl() in C++?</a> which seemed sensible):</p>
  
  <pre><code>#include &lt;stdint.h&gt;
  #if defined(__linux__)
  #include &lt;endian.h&gt; //htobe64,be64toh
  #include &lt;arpa/inet.h&gt; //ntohs, ntohl, htonl, htons
  #elif defined(__FreeBSD__) || defined(__NetBSD__)
  #include &lt;sys/endian.h&gt;
  #elif defined(__OpenBSD__)
  #include &lt;sys/types.h&gt;
  #define be16toh(x) betoh16(x)
  #define be32toh(x) betoh32(x)
  #define be64toh(x) betoh64(x)
  #endif
  
  int main()
  {
      int64_t i = 0x1212121234343434;
      int64_t j = be64toh(i);
      return 0;
  }
  </code></pre>
  
  <p>I get a linking error when compiling it with the following command (I'm running linux):</p>
  
  <pre><code>gcc -std=c99 endian_test.c -o endian
  </code></pre>
  
  <p>The error i receive is:</p>
  
  <pre><code>user@host ~/src/c $ gcc -std=c99 derp.c 
  endian_test.c: In function ‘main’:
  endian_test.c:17:2: warning: implicit declaration of function ‘be64toh’ [-Wimplicit-function-declaration]
    int64_t j = be64toh(i);
    ^
  /tmp/ccYonfH4.o: In function `main':
  endian_test.c:(.text+0x23): undefined reference to `be64toh'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>Which to me indicates two things, the header itself is included but doesn't really contain the functions/macros needed for this to work and because that means the compiler hopes it's gonna find the function later it tries to go ahead anyway but fails when trying to link.</p>
  
  <p>But if i use the following command to compile (just remove <code>-std=c99</code>):</p>
  
  <pre><code>gcc endian_test.c -o endian
  </code></pre>
  
  <p>Everything is smooth as butter and works. Any idea why it's happening and what i could do to remedy it? To me it doesn't make sense that functions given by the kernel (or am i mistaken in that fact?) change depending on what standard i use when compiling?</p>
  
  <p>Thanks in advance!</p>