Thread: Re: [HACKERS] CVS -Tip compile issue -- FreeBSD 4.8
> First thought that comes to mind is that <sys/socket.h> may require > something else to be included first --- maybe <sys/types.h> ? That did it. It's a little curious that sys/socket.h doesn't mention that anywhere though. -- Rod Taylor <rbt@rbt.ca> PGP Key: http://www.rbt.ca/rbtpub.asc
Attachment
Rod Taylor <rbt@rbt.ca> writes: >> First thought that comes to mind is that <sys/socket.h> may require >> something else to be included first --- maybe <sys/types.h> ? > That did it. It's a little curious that sys/socket.h doesn't mention > that anywhere though. I see a couple of places where configure neglects to include sys/types before sys/socket. Fixing now. regards, tom lane
Rod Taylor writes: > > First thought that comes to mind is that <sys/socket.h> may require > > something else to be included first --- maybe <sys/types.h> ? > > That did it. It's a little curious that sys/socket.h doesn't mention > that anywhere though. Because it shouldn't be so. Can you look in config.log what the real reason of the failure was? Maybe it's a bug in FreeBSD. -- Peter Eisentraut peter_e@gmx.net
Peter Eisentraut <peter_e@gmx.net> writes: > Rod Taylor writes: >>> First thought that comes to mind is that <sys/socket.h> may require >>> something else to be included first --- maybe <sys/types.h> ? >> >> That did it. It's a little curious that sys/socket.h doesn't mention >> that anywhere though. > Because it shouldn't be so. Can you look in config.log what the real > reason of the failure was? Maybe it's a bug in FreeBSD. It's been true for years that <sys/socket.h> requires <sys/types.h> on some platforms. How do you think I knew what to recommend? There's no point in arguing about it, it's just a fact. regards, tom lane
The man page for socket on Linux says you need both, but you can get away without it. It's easy enough to test if a platform does the sane thing: [andrew@Thor andrew]$ echo '#include <sys/socket.h>' > blurfl.c [andrew@Thor andrew]$ gcc -E -M blurfl.c blurfl.o: blurfl.c /usr/include/sys/socket.h /usr/include/features.h \ /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ /usr/include/sys/uio.h /usr/include/sys/types.h \ [snip] Probably the best bet is just include sys/types.h just before any place sys/socket.h is included, no? Should be harmless enough. cheers andrew Tom Lane wrote: > Peter Eisentraut <peter_e@gmx.net> writes: >> Rod Taylor writes: >>>> First thought that comes to mind is that <sys/socket.h> may require >>>> something else to be included first --- maybe <sys/types.h> ? >>> >>> That did it. It's a little curious that sys/socket.h doesn't mention >>> that anywhere though. > >> Because it shouldn't be so. Can you look in config.log what the real >> reason of the failure was? Maybe it's a bug in FreeBSD. > > It's been true for years that <sys/socket.h> requires <sys/types.h> on > some platforms. How do you think I knew what to recommend? There's no > point in arguing about it, it's just a fact. > > regards, tom lane >
Tom Lane writes: > It's been true for years that <sys/socket.h> requires <sys/types.h> on > some platforms. How do you think I knew what to recommend? There's > no point in arguing about it, it's just a fact. Sure, but it still may be a bug in FreeBSD if they don't document it and if they pretend to follow standards, which they do. -- Peter Eisentraut peter_e@gmx.net