Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2003-02-09 11:37:01


> > a. _POSIX_C_SOURCE is not defined
>
> It's probably being overly picky requiring that one to be defined,
strictly
> speaking you can't use any POSIX API's unless _POSIX_C_SOURCE has been
> defined before the inclusion of any std header - most platforms don't seem
> to care though.
>
> > b. _POSIX_VERSION is smaller
>
> Particular platforms may have sigaction support even though they only
claim
> conformance to an earlier version of the POSIX standard - cygwin is one -
> check for __CYGWIN__.

So as a result we will get:

#if defined(__CYGWIN__) ||
     defined(_POSIX_VERSION) && (_POSIX_VERSION >= 199506L)

Did I get it correct now? But look here what I dig up in status pages (not
all compilers unfortunately provide config_info):

A) gcc 3.1 on MacOS
_POSIX_C_SOURCE is not defined
_POSIX_VERSION=198808L
_POSIX2_VERSION=199212L

B) gcc 3.2 on HPUX
_POSIX_C_SOURCE is not defined
_POSIX_VERSION=199009L
_POSIX2_VERSION=199209L

C) gcc 3.2, gcc 2.95.3, intel 6.0, intel 7.0 kylix on linux
_POSIX_C_SOURCE is defined
_POSIX_VERSION=199506L

_POSIX2_VERSION=199209L

D) gcc 2.95.3, gcc 3.2 on OpenBSD
_POSIX_C_SOURCE is not defined
_POSIX_VERSION=199009L

_POSIX2_VERSION=199212L

Cases A,B and D will be ruled out.

Any suggestions?

Gennadiy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk