Use of _XOPEN_SOURCE?
Corinna Vinschen
vinschen@redhat.com
Wed Mar 17 15:38:00 GMT 2010
On Mar 16 18:48, Howland Craig D (Craig) wrote:
> Patch attached, allowing for _XOPEN_SOURCE to be empty when setting
> _POSIX_C_SOURCE values in sys/features.h. I also added two older values
> for it.
>
> (While I found that _POSIX_C_SOURCE can take the value 199309L, I did
> not find the basis upon which that value can be set. If someone happens
> to know and could fill me in, I could add it.)
I don't know either, but, here's a question. What about values between
500 and 600 or between 600 and 700? Shouldn't the code be more
forgiving, like this:
#if (_XOPEN_SOURCE - 0) >= 700 /* POSIX.1-2008 */
#define _POSIX_C_SOURCE 200809L
#elif (_XOPEN_SOURCE - 0) >= 600 /* POSIX.1-2001 or 2004 */
#define _POSIX_C_SOURCE 200112L
#elif (_XOPEN_SOURCE - 0) >= 500 /* POSIX.1-1995 */
#define _POSIX_C_SOURCE 199506L
#else
#define _POSIX_C_SOURCE 2
#endif
?
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
More information about the Newlib
mailing list