Browse Source

sync features.h with GNU C library, fixes gcc 7.1 toolchain creation

Waldemar Brodkorb 8 years ago
parent
commit
5b0f49037e
1 changed files with 12 additions and 5 deletions
  1. 12 5
      include/features.h

+ 12 - 5
include/features.h

@@ -55,6 +55,7 @@
    These are defined by this file and are used by the
    These are defined by this file and are used by the
    header files to decide what to declare or define:
    header files to decide what to declare or define:
 
 
+   __USE_ISOC11		Define ISO C11 things.
    __USE_ISOC99		Define ISO C99 things.
    __USE_ISOC99		Define ISO C99 things.
    __USE_ISOC95		Define ISO C90 AMD1 (C95) things.
    __USE_ISOC95		Define ISO C90 AMD1 (C95) things.
    __USE_POSIX		Define IEEE Std 1003.1 things.
    __USE_POSIX		Define IEEE Std 1003.1 things.
@@ -91,6 +92,7 @@
 
 
 
 
 /* Undefine everything, so we get a clean slate.  */
 /* Undefine everything, so we get a clean slate.  */
+#undef	__USE_ISOC11
 #undef	__USE_ISOC99
 #undef	__USE_ISOC99
 #undef	__USE_ISOC95
 #undef	__USE_ISOC95
 #undef	__USE_POSIX
 #undef	__USE_POSIX
@@ -151,6 +153,8 @@
 #ifdef _GNU_SOURCE
 #ifdef _GNU_SOURCE
 # undef  _ISOC99_SOURCE
 # undef  _ISOC99_SOURCE
 # define _ISOC99_SOURCE	1
 # define _ISOC99_SOURCE	1
+# undef  _ISOC11_SOURCE
+# define _ISOC11_SOURCE	1
 # undef  _POSIX_SOURCE
 # undef  _POSIX_SOURCE
 # define _POSIX_SOURCE	1
 # define _POSIX_SOURCE	1
 # undef  _POSIX_C_SOURCE
 # undef  _POSIX_C_SOURCE
@@ -223,11 +227,14 @@
 # define _SVID_SOURCE	1
 # define _SVID_SOURCE	1
 #endif
 #endif
 
 
-/* This is to enable the ISO C99 extension.  Also recognize the old macro
+/* This is to enable the ISO C11 extension.  */
-   which was used prior to the standard acceptance.  This macro will
+#if (defined _ISOC11_SOURCE \
-   eventually go away and the features enabled by default once the ISO C99
+     || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L))
-   standard is widely adopted.  */
+# define __USE_ISOC11	1
-#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
+#endif
+
+/* This is to enable the ISO C99 extension.  */
+#if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \
      || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
      || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
 # define __USE_ISOC99	1
 # define __USE_ISOC99	1
 #endif
 #endif