Subject: Re: XOPEN_SOURCE
To: None <current-users@netbsd.org>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: current-users
Date: 01/31/2000 22:55:43
Just found better descriptions of the problem in standards/8050 and 8879
but don't know what to do about it..

On Mon, Jan 31, 2000 at 10:29:29PM +0000, Patrick Welche wrote:
> What is the meaning of XOPEN_SOURCE? Some autoconf/configure or whatever
> utility decided that a i386 running today's current was
> 
> #define __EXTENSIONS__  1
> #define _POSIX_C_SOURCE  199506L
> #define _XOPEN_SOURCE  500
> #define _XOPEN_SOURCE_EXTENDED  1
> 
> which leads to the following problem:
> 
> unistd.h declares:
> 
> Ah - got it - not obvious, just 2 characters difference ...
> 
> /* FIXME: this should go to <sys/time.h>! */
> #if __STDC__
> struct timeval;                         /* select(2) XXX */
> #endif
> int      select __P((int, fd_set *, fd_set *, fd_set *, struct timeval *));
> #endif /* (!defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)) || ... */
> 
> but that last comment beside the #endif isn't actually true.. it matches
> 
> #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
>                     ^^
> 
> _C
> 
> but the definition of fd_set in sys/types.h is defended by
> 
> #if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
> 
> (no _C) => there is an inconsistency. (end result: ImageMagick doesn't
> compile...)
> 
> What is right? _C or no _C? or both?
> 
> Cheers,
> 
> Patrick