aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-12-23 22:45:16 -0500
committerUlrich Drepper <drepper@gmail.com>2012-01-01 07:17:19 -0500
commitd78099052b6bdc164f8f6a582a9b7b574f700e28 (patch)
treeb9cbf580e23f56a809e86f06260623d6e696083f /include
parenta316c1f6823590fc6209e470c77d4cb44f4e2f50 (diff)
downloadglibc-d78099052b6bdc164f8f6a582a9b7b574f700e28.tar
glibc-d78099052b6bdc164f8f6a582a9b7b574f700e28.tar.gz
glibc-d78099052b6bdc164f8f6a582a9b7b574f700e28.tar.bz2
glibc-d78099052b6bdc164f8f6a582a9b7b574f700e28.zip
Support C11 __STDC_SOURCE__ and _ISOC11_SOURCE
Diffstat (limited to 'include')
-rw-r--r--include/features.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/include/features.h b/include/features.h
index c7b7972806..b02ff750d3 100644
--- a/include/features.h
+++ b/include/features.h
@@ -25,6 +25,7 @@
__STRICT_ANSI__ ISO Standard C.
_ISOC99_SOURCE Extensions to ISO C89 from ISO C99.
+ _ISOC11_SOURCE Extensions to ISO C99 from ISO C11.
_POSIX_SOURCE IEEE Std 1003.1.
_POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
if >=199309L, add IEEE Std 1003.1b-1993;
@@ -57,6 +58,7 @@
These are defined by this file and are used by the
header files to decide what to declare or define:
+ __USE_ISOC11 Define ISO C11 things.
__USE_ISOC99 Define ISO C99 things.
__USE_ISOC95 Define ISO C90 AMD1 (C95) things.
__USE_POSIX Define IEEE Std 1003.1 things.
@@ -95,6 +97,7 @@
/* Undefine everything, so we get a clean slate. */
+#undef __USE_ISOC11
#undef __USE_ISOC99
#undef __USE_ISOC95
#undef __USE_POSIX
@@ -158,6 +161,8 @@
# define _ISOC95_SOURCE 1
# undef _ISOC99_SOURCE
# define _ISOC99_SOURCE 1
+# undef _ISOC11_SOURCE
+# define _ISOC11_SOURCE 1
# undef _POSIX_SOURCE
# define _POSIX_SOURCE 1
# undef _POSIX_C_SOURCE
@@ -185,17 +190,18 @@
# define _SVID_SOURCE 1
#endif
-/* This is to enable the ISO C99 extension. Also recognize the old macro
- which was used prior to the standard acceptance. This macro will
- eventually go away and the features enabled by default once the ISO C99
- standard is widely adopted. */
-#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
+/* This is to enable the ISO C11 extension. */
+#if (defined _ISOC11_SOURCE \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L))
+
+/* This is to enable the ISO C99 extension. */
+#if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \
|| (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
# define __USE_ISOC99 1
#endif
/* This is to enable the ISO C90 Amendment 1:1995 extension. */
-#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
+#if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \
|| (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L))
# define __USE_ISOC95 1
#endif