Hi Simon, Compiling coreutils-6.0 on BeOS gives this:
source='getaddrinfo.c' object='getaddrinfo.o' libtool=no \ DEPDIR=.deps depmode=gcc /bin/sh ../build-aux/depcomp \ gcc -DHAVE_CONFIG_H -DLIBDIR=\"/boot/home/config/lib\" -I. -I. -I.. -I.. -I. -Wall -I/boot/home/config/include -g -O2 -c getaddrinfo.c /boot/home/gnubuild/coreutils-6.0/lib/getaddrinfo.c: In function `validate_family': /boot/home/gnubuild/coreutils-6.0/lib/getaddrinfo.c:100: `PF_INET' undeclared (first use in this function) /boot/home/gnubuild/coreutils-6.0/lib/getaddrinfo.c:100: (Each undeclared identifier is reported only once /boot/home/gnubuild/coreutils-6.0/lib/getaddrinfo.c:100: for each function it appears in.) /boot/home/gnubuild/coreutils-6.0/lib/getaddrinfo.c:107: `PF_UNSPEC' undeclared (first use in this function) /boot/home/gnubuild/coreutils-6.0/lib/getaddrinfo.c: In function `getaddrinfo': /boot/home/gnubuild/coreutils-6.0/lib/getaddrinfo.c:205: `PF_INET' undeclared (first use in this function) /boot/home/gnubuild/coreutils-6.0/lib/getaddrinfo.c:206: warning: unreachable code at beginning of switch statement /boot/home/gnubuild/coreutils-6.0/lib/getaddrinfo.c:247: warning: unreachable code at beginning of switch statement make[3]: *** [getaddrinfo.o] Error 1 make[3]: Leaving directory `/boot/home/gnubuild/coreutils-6.0/lib' The reason is that BeOS does not have PF_INET, only AF_INET, but usually they have the same values. Also it doesn't have PF_UNSPEC. This is quite a hacky fix, but I don't know what value could be used for PF_UNSPEC if we were to make a <sys/socket.h> override. 2006-08-19 Bruno Haible <[EMAIL PROTECTED]> BeOS portability. * lib/getaddrinfo.c (PF_INET): Fallback define. (validate_family): Don't recognize PF_UNSPEC if it doesn't exist. *** lib/getaddrinfo.c.bak 2006-08-10 09:17:38.000000000 +0200 --- lib/getaddrinfo.c 2006-08-19 15:25:02.000000000 +0200 *************** *** 42,47 **** --- 42,52 ---- #include "snprintf.h" #include "strdup.h" + /* BeOS has AF_INET, but not PF_INET. */ + #ifndef PF_INET + # define PF_INET AF_INET + #endif + #if defined _WIN32 || defined __WIN32__ # define WIN32_NATIVE #endif *************** *** 104,111 **** --- 109,118 ---- if (family == PF_INET6) return true; #endif + #ifdef PF_UNSPEC /* BeOS lacks PF_UNSPEC. */ if (family == PF_UNSPEC) return true; + #endif return false; }