components/gcc53/patches/007-std-macros.patch
changeset 5342 e55d87e99ecd
child 5444 9f72ce29e7f4
equal deleted inserted replaced
5341:acafdc8d7dfc 5342:e55d87e99ecd
       
     1 #
       
     2 #  Based on GCC 4.9 patches, set corresponding standards based
       
     3 #  feature macros.  This may need to be revisited and coordinated
       
     4 #  with additional header changes.  This is not being submitted
       
     5 #  upstream until we have a clear path forward.
       
     6 #
       
     7 --- gcc-5.3.0/gcc/config/sol2.h.orig	Sat Jan 16 22:00:10 2016
       
     8 +++ gcc-5.3.0/gcc/config/sol2.h	Sat Jan 16 22:02:58 2016
       
     9 @@ -94,12 +94,26 @@
       
    10  	   library.  */					\
       
    11  	if (c_dialect_cxx ())				\
       
    12  	  {						\
       
    13 -	    builtin_define ("__STDC_VERSION__=199901L");\
       
    14 -	    builtin_define ("_XOPEN_SOURCE=600");	\
       
    15 -	    builtin_define ("_LARGEFILE_SOURCE=1");	\
       
    16 -	    builtin_define ("_LARGEFILE64_SOURCE=1");	\
       
    17 -	    builtin_define ("__EXTENSIONS__");		\
       
    18 -	  }						\
       
    19 +            switch (cxx_dialect)			\
       
    20 +              {			\
       
    21 +              case cxx03: /* same as cxx98 */		\
       
    22 +                builtin_define ("__STDC_VERSION__=199409L");\
       
    23 +                builtin_define ("_XOPEN_SOURCE=500");	\
       
    24 +                break;					\
       
    25 +              case cxx11:				\
       
    26 +              case cxx14:				\
       
    27 +                builtin_define ("__STDC_VERSION__=199901L");\
       
    28 +                builtin_define ("_XOPEN_SOURCE=700");	\
       
    29 +                break;					\
       
    30 +              default:					\
       
    31 +	        builtin_define ("__STDC_VERSION__=199901L");\
       
    32 +                builtin_define ("_XOPEN_SOURCE=600");	\
       
    33 +                break;					\
       
    34 +              }						\
       
    35 +            builtin_define ("_LARGEFILE_SOURCE=1");	\
       
    36 +            builtin_define ("_LARGEFILE64_SOURCE=1");	\
       
    37 +            builtin_define ("__EXTENSIONS__=1");	\
       
    38 +          }					        \
       
    39  	TARGET_SUB_OS_CPP_BUILTINS();			\
       
    40      } while (0)
       
    41  
       
    42