compile error - GNU/Linux - "S_IFMT" undeclared

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. 

(Continue reading)

Dustin Voss | 9 Feb 22:53
Picon

Re: compile error - GNU/Linux - "S_IFMT" undeclared

Can you find out more about S_IFREG? It may be in the header files,  
but #ifdef'd out or something.

On Feb 9, 2008, at 11:45 AM, Danny Milosavljevic wrote:

> 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-
(Continue reading)


Gmane