[PATCH] Use posix headers in sumversion.c

From: Benno
Date: Tue Aug 10 2004 - 08:48:13 EST


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.

A patch against 2.6.7 which change <netinet/in.h> -> <arpa/inet.h> is
attached.

Cheers,

Benno
--- sumversion.c 2004-08-10 23:26:27.000000000 +1000
+++ sumversion.c.orig 2004-08-10 23:26:08.000000000 +1000
@@ -1,4 +1,4 @@
-#include <arpa/inet.h>
+#include <netinet/in.h>
#include <stdint.h>
#include <ctype.h>
#include <errno.h>