Proper Conditionals for POSIX CX and XSI
Mon Aug 26 07:49:00 GMT 2013
On Thursday 18 July 2013 04:01:42 Yaakov (Cygwin/X) wrote:
> On 2013-07-17 19:56, Sebastian Huber wrote:
> > On 2013-07-18 06:15, Yaakov (Cygwin/X) wrote:
> >> On 2013-07-17 15:34, Joel Sherrill wrote:
> >>> While this was still fresh, I wanted to ask what was the
> >>> proper conditional for methods marked as CX or XSI
> >>> in the POSIX standard.
> >> This is what is done in glibc:
> >> http://man7.org/linux/man-pages/man7/feature_test_macros.7.html
> >> In short, <features.h> recognizes _*_SOURCE macros, which it uses to set
> >> various __USE_* private macros which are used throughout the headers as
> >> conditionals to control which APIs are made available.
> >> Having this done *properly* in the Newlib/Cygwin headers would be a
> >> big step to
> >> fixing a lot of compiling incompatibilities with glibc. It is also a
> >> very
> >> tedious task, although it may not have to be done all at once
> > Unfortunately the GNU and BSD people don't talk much with each other.
> > In FreeBSD we have this _*_SOURCE evaluation in <sys/cdefs.h>. Since I
> > updated Newlibs "newlib/libc/include/sys/cdefs.h" a couple of weeks ago
> > we should consider to use the infrastructure already available (see line
> > 535 and below). Due to license issues it is more likely that Newlib
> > will use code from BSD sources.
> AFAIK it doesn't really matter which header provides this functionality,
> as long as all affected headers include that one.
correct. all POSIX says is that you have to define things before you go
including headers. the C library takes care of including the right file as
needed (whether it be features.h or sys/cdefs.h or some other random file).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: This is a digitally signed message part.
More information about the Newlib