This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Define _POSIX_SOURCE in cygwin's features.h?


Christopher Faylor, le Thu 12 Jan 2006 12:59:08 -0500, a écrit :
> >>Someone on the cygwin irc channel had a problem building a package
> >>which would have been solved if Cygwin defined _POSIX_SOURCE.

If the package doesn't define _POSIX_SOURCE itself then it needs be
fixed, not cygwin.

> _POSIX_SOURCE is defined in features.h on linux under control of the
> _GNU_SOURCE macro.


>   /* If _GNU_SOURCE was defined by the user, turn on all the other features.  */
>   #ifdef _GNU_SOURCE
>   # define _POSIX_SOURCE  1
>   #endif
> So, let me clarify.  Should we define _POSIX_SOURCE similarly to the way
> that linux does it?  This may mean that we have to define _GNU_SOURCE
> also and maybe that's not a good idea but, again, it might solve more
> problems than it causes.

No. It can create a lot of other problems.
Maybe cygwin could #define _POSIX_SOURCE to 1 if the user _already_
defined _GNU_SOURCE.
But a portable program should _not_ assume that #defining _GNU_SOURCE
implies that _POSIX_SOURCE. If a program not only needs posix stuff but
also some GNU extras, it should #define _GNU_SOURCE _and_ _POSIX_SOURCE


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]