diff options
author | Sam Ravnborg <sam@mars.ravnborg.org> | 2004-08-11 02:11:50 +0200 |
---|---|---|
committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2004-08-11 02:11:50 +0200 |
commit | e78d165503d0dfefeed18f48f722f4bf4ad79014 (patch) | |
tree | 2a0cd5615ef31a3c59f9a450f72c348e2dcbf2ba /scripts | |
parent | 3fe519b21b33a395c2e3b01ee70289a0899014ee (diff) | |
download | history-e78d165503d0dfefeed18f48f722f4bf4ad79014.tar.gz |
kbuild: Use POSIX headers for ntoh functions
From: Benno <benjl@cse.unsw.edu.au>
When compiling Linux on Mac OSX I had trouble with scripts/sumversion.c.
It includes <netinet/in.h> to obtain to definitions of htonl and ntohl.
On Mac OSX these are found in <arpa/inet.h>. After checking the POSIX
specification it appears that this is the correct place to get
the definitons for these functions.
(http://www.opengroup.org/onlinepubs/009695399/functions/htonl.html)
Using this header also appears to work on Linux (at least with
Glibc-2.3.2).
It seems clearer to me to go with the POSIX standard than implementing
#if __APPLE__ style macros, but if such an approach is preferred I can
supply patches for that instead.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/basic/fixdep.c | 2 | ||||
-rw-r--r-- | scripts/mod/sumversion.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 8bd6442229cf06..9c03a6673aad6e 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -104,7 +104,7 @@ #include <stdio.h> #include <limits.h> #include <ctype.h> -#include <netinet/in.h> +#include <arpa/inet.h> #define INT_CONF ntohl(0x434f4e46) #define INT_ONFI ntohl(0x4f4e4649) diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c index b41b718edffefa..631430d09e4ded 100644 --- a/scripts/mod/sumversion.c +++ b/scripts/mod/sumversion.c @@ -1,4 +1,4 @@ -#include <netinet/in.h> +#include <arpa/inet.h> #include <stdint.h> #include <ctype.h> #include <errno.h> |