* [PATCH] Use posix headers in sumversion.c
@ 2004-08-10 13:41 Benno
2004-08-10 20:12 ` Sam Ravnborg
0 siblings, 1 reply; 2+ messages in thread
From: Benno @ 2004-08-10 13:41 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 736 bytes --]
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
[-- Attachment #2: sumversion.patch --]
[-- Type: text/plain, Size: 237 bytes --]
--- 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>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Use posix headers in sumversion.c
2004-08-10 13:41 [PATCH] Use posix headers in sumversion.c Benno
@ 2004-08-10 20:12 ` Sam Ravnborg
0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2004-08-10 20:12 UTC (permalink / raw)
To: Benno; +Cc: Andrew Morton, Linux Kernel Mailing List
On Tue, Aug 10, 2004 at 11:41:02PM +1000, Benno wrote:
> 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.
Your patch was reverse...
I fixed up fixdep.c as well.
Thanks,
Sam
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-08-10 20:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-10 13:41 [PATCH] Use posix headers in sumversion.c Benno
2004-08-10 20:12 ` Sam Ravnborg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®