aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/include
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-03-17 17:13:00 +0000
committerCorinna Vinschen <corinna@vinschen.de>2010-03-17 17:13:00 +0000
commit5e74a46f2fa91a3fb71b85714cc1764481316c37 (patch)
tree190bb872dc4d7cba4c85319b423a99f40988a2dc /newlib/libc/include
parenta24d322c7670120fb8ac90fe8f1e40574534b45d (diff)
downloadnewlib-5e74a46f2fa91a3fb71b85714cc1764481316c37.zip
newlib-5e74a46f2fa91a3fb71b85714cc1764481316c37.tar.gz
newlib-5e74a46f2fa91a3fb71b85714cc1764481316c37.tar.bz2
* libc/include/sys/features.h: Allow for _XOPEN_SOURCE to have an
empty definition. Also add support for values of 500 or less.
Diffstat (limited to 'newlib/libc/include')
-rw-r--r--newlib/libc/include/sys/features.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h
index e7968e0..0277fb0 100644
--- a/newlib/libc/include/sys/features.h
+++ b/newlib/libc/include/sys/features.h
@@ -183,13 +183,19 @@ extern "C" {
/* Per the permission given in POSIX.1-2008 section 2.2.1, define
* _POSIX_C_SOURCE if _XOPEN_SOURCE is defined and _POSIX_C_SOURCE is not.
* (_XOPEN_SOURCE indicates that XSI extensions are desired by an application.)
- * This permission is first granted in 2008, but it is used for 2001, anyway.
+ * This permission is first granted in 2008, but use it for older ones, also.
+ * Allow for _XOPEN_SOURCE to be empty (from the earliest form of it, before it
+ * was required to have specific values).
*/
#if !defined(_POSIX_C_SOURCE) && defined(_XOPEN_SOURCE)
- #if _XOPEN_SOURCE == 700 /* POSIX.1-2008 */
+ #if (_XOPEN_SOURCE - 0) == 700 /* POSIX.1-2008 */
#define _POSIX_C_SOURCE 200809L
- #elif _XOPEN_SOURCE == 600 /* POSIX.1-2001 */
+ #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
+ #elif (_XOPEN_SOURCE - 0) < 500 /* really old */
+ #define _POSIX_C_SOURCE 2
#endif
#endif