[Gd-hackers] compile error - GNU/Linux - "S_IFMT" undeclared
Danny Milosavljevic
danny.milo at scratchpost.org
Sat Feb 9 20:45:12 CET 2008
Hi,
I just tried to update Gwydion Dylan from SVN on my Gentoo Linux box and
got this:
----------------------------------------------------
gcc -Wall -Wno-unused-variable -I. -O2 -fno-strict-aliasing -
D_POSIX_C_SOURCE -I/var/tmp/portage/dev-lang/gwydion-dylan-2.4.99/work/
src/d2c/runtime -I/var/tmp/portage/dev-lang/gwydion-dylan-2.4.99/work/src
-DGD_PLATFORM_LINUX -D_POSIX_C_SOURCE -I/var/tmp/portage/dev-lang/
gwydion-dylan-2.4.99/work/src/common/io -c /var/tmp/portage/dev-lang/
gwydion-dylan-2.4.99/work/src/common/io/unix-portability.c -o unix-
portability.o
/var/tmp/portage/dev-lang/gwydion-dylan-2.4.99/work/src/common/io/unix-
portability.c: In function 'io_fd_info':
/var/tmp/portage/dev-lang/gwydion-dylan-2.4.99/work/src/common/io/unix-
portability.c:17: error: 'S_IFMT' undeclared (first use in this function)
/var/tmp/portage/dev-lang/gwydion-dylan-2.4.99/work/src/common/io/unix-
portability.c:17: error: (Each undeclared identifier is reported only once
/var/tmp/portage/dev-lang/gwydion-dylan-2.4.99/work/src/common/io/unix-
portability.c:17: error: for each function it appears in.)
/var/tmp/portage/dev-lang/gwydion-dylan-2.4.99/work/src/common/io/unix-
portability.c:17: error: 'S_IFREG' undeclared (first use in this function)
make: *** [unix-portability.o] Error 1
----------------------------------------------------
If I add
#define _XOPEN_SOURCE 500
to the beginning of "portability.c", it works.
Though: I tried whether it compiles in a standalone C test program and
there it works fine even without the "#define". Weird...
"gcc -E -dD" log is:
<http://www.scratchpost.org/patches/dylan_compile_gcc_-E_-dD_log>
cheers,
Danny
More information about the hackers
mailing list