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?


On Thu, Jan 12, 2006 at 06:13:16PM -0000, Dave Korn wrote:
>Christopher Faylor wrote:
>>_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
>
>... which is equally something that belongs to and is under control of the
>user's application, and is a way for the user's application to specify (to the
>compiler, C runtime, and whoever else) that it's compliant and requires/copes
>with POSIX compliant source in the system header files.

...which doesn't really invalidate the question of whether cygwin should
be trying to set up its headers the same way as linux.

>>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.
>
>I think it means that whoever you were talking to in the IRC channel
>should have defined _POSIX_SOURCE in their application, and the bug is
>that they didn't when they should have.

Ok.  I assumed that some header set _GNU_SOURCE but apparently I was
wrong.  I should have checked.

Just to add even more clarification, this wasn't some guy writing a
program for his class assignment.  It was someone trying to port a
standard linux/unix application.  The program had a test for
_POSIX_SOURCE which would have worked correctly under Cygwin.  I don't
know if it was setting _GNU_SOURCE to get this or if the _POSIX_SOURCE
test just wasn't discovered by configure.

So, maybe this boils down to the question of whether there's something
about Cygwin which makes configure think it shouldn't set _POSIX_SOURCE
or _GNU_SOURCE.  Maybe it is just that uname doesn't return the string
"linux".

Again, I'm not really interested in hearing what someone should have
done or should have known to do.  If there is a way to make porting a
program to cygwin easier without requiring some special knowledge that
isn't required on linux, then I'll probably take steps to make that
happen.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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