On Fri, May 27, 2005 at 11:11:03AM -0700, Joseph McDonald wrote: Hi Joe In our linux systems here these kind of system macros are set in the header file /usr/include/features.h, which is include by just about any of the other includes in /usrc/include. So probably there is a similar one on you BSD system. I you could send this file or look into it and find out when BSD_VISIBLE gets set we may fix it the proper way. Thanks Niels
Hi Niels!
I read some documentation about BSD_VISIBLE. And they claim its a variable you/we shouldn't set. As its supposed to be set correctly by the system headers.
So I would like to know what part of the compilation went wrong, ie. which function we use outside of the POSIX_C_SOURCE=200112 set.
Yeah, I read that as well, but I don't know of a way around it right now (I'm not a C hacker).
Here is the error I get if I fail to define __BSD_VISIBLE:
(cd .libs && rm -f libmutils.la && ln -s ../libmutils.la libmutils.la) /usr/local/bin/bash ../../libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I. -DLIBSTREAM -g -O2 -std=c99 -Wall -W -fno-strict-aliasing -Werror-implicit-functio n-declaration -Werror -Wno-format -Wno-unused-function -Wno-unused-label -D_REENTRANT -c -o libstream_la-stream.lo `test -f 'stream.c' || echo './'`stream.c gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I. -DLIBSTREAM -g -O2 -std=c99 -Wall -W -fno-strict-ali asing -Werror-implicit-function-declaration -Werror -Wno-format -Wno-unused-function -Wno-unu sed-label -D_REENTRANT -c stream.c -fPIC -DPIC -o .libs/libstream_la-stream.o In file included from stream.mx:265: /usr/include/netinet/ip.h:49: error: syntax error before "u_int" /usr/include/netinet/ip.h:148: error: syntax error before "u_char" /usr/include/netinet/ip.h:200: error: syntax error before "u_char"
The problem is that netinet/ip.h looks like this:
struct ip { #if BYTE_ORDER == LITTLE_ENDIAN u_int ip_hl:4, /* header length */ ip_v:4; /* version */ #endif #if BYTE_ORDER == BIG_ENDIAN u_int ip_v:4, /* version */ ip_hl:4; /* header length */ #endif u_char ip_tos; /* type of service */ u_short ip_len; /* total length */ [...]
if I set __BSD_VISIBLE then u_int, u_char are typedef'd (in sys/types.h), otherwise they are not.
There is probably a better way, I just don't know what it is.
thanks, -joe
-- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl