diff options
| author | Ulrich Drepper <drepper@gmail.com> | 2012-01-03 07:54:34 -0500 |
|---|---|---|
| committer | Ulrich Drepper <drepper@gmail.com> | 2012-01-03 07:54:34 -0500 |
| commit | aff067358751a03ad1f9e397204490b8bfb2fb29 (patch) | |
| tree | 6d462d2049b215370a4f1075629d71e695ba600d /include | |
| parent | 9f1151705e3d861a4d6d680e74158cd708119053 (diff) | |
| parent | db6af3ebf46a83b885455dc03a3c2c1c2c2dedec (diff) | |
| download | glibc-aff067358751a03ad1f9e397204490b8bfb2fb29.tar.xz glibc-aff067358751a03ad1f9e397204490b8bfb2fb29.zip | |
Merge branch 'c11'
Diffstat (limited to 'include')
| -rw-r--r-- | include/features.h | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/include/features.h b/include/features.h index c7b7972806..7bb27c5b08 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,8 +97,10 @@ /* Undefine everything, so we get a clean slate. */ +#undef __USE_ISOC11 #undef __USE_ISOC99 #undef __USE_ISOC95 +#undef __USE_ISOCXX11 #undef __USE_POSIX #undef __USE_POSIX2 #undef __USE_POSIX199309 @@ -158,6 +162,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,21 +191,33 @@ # 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)) +# define __USE_ISOC11 1 +#endif + +/* 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 +/* This is to enable compatibility for ISO C++11. + + So far g++ does not provide a macro. Check the temporary macro for + now, too. */ +#if ((defined __cplusplus && __cplusplus >= 201103L) \ + || defined __GXX_EXPERIMENTAL_CXX0X__) +# define __USE_ISOCXX11 1 +#endif + /* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2 (and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */ #if ((!defined __STRICT_ANSI__ || (_XOPEN_SOURCE - 0) >= 500) && \ |
