X-Spam-Check-By: sourceware.org
X-T2-Posting-ID: dCnToGxhL58ot4EWY8b+QGwMembwLoz1X2yB7MdtIiA=
X-Cloudmark-Score: 0.000000 []
Date: Thu, 12 Jan 2006 19:08:32 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: cygwin@cygwin.com
Subject: Re: Define _POSIX_SOURCE in cygwin's features.h?
Message-ID: <20060112180832.GA4855@bouh.residence.ens-lyon.fr>
Mail-Followup-To: cygwin@cygwin.com
References: <20060112173104.GA30011@trixie.casa.cgf.cx> <SERRANOzDskqC5EtrUV000000c2@SERRANO.CAM.ARTIMI.COM> <20060112175908.GB30108@trixie.casa.cgf.cx>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20060112175908.GB30108@trixie.casa.cgf.cx>
User-Agent: Mutt/1.5.9i-nntp
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Hi,

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.

Indeed.

>   /* 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
itself.

Regards,
Samuel

--
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/

