diff options
author | ro <ro@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-21 15:27:29 +0000 |
---|---|---|
committer | ro <ro@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-21 15:27:29 +0000 |
commit | a6905708d86d6c2d8560168ac5accb816a2038c8 (patch) | |
tree | edfae00a397941520330c85dfbe0358fbc178307 /fixincludes | |
parent | bbc7bed2e0ba2c1533a3263f4b7057b0b03c6fa3 (diff) | |
download | gcc-a6905708d86d6c2d8560168ac5accb816a2038c8.tar.gz |
gcc:
* config/sol2.h (TARGET_OS_CPP_BUILTINS): Define
__STDC_VERSION__=199901L, _XOPEN_SOURCE=600 for C++.
fixincludes:
* inclhack.def (solaris__restrict, solaris_complex_cxx): New fixes
* fixincl.x: Regenerate.
* tests/base/complex.h [SOLARIS_COMPLEX_CXX_CHECK]: New test.
* tests/base/sys/feature_tests.h: New file.
libstdc++-v3:
* testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc:
Add *-*-solaris2.1[0-9]* to dg-xfail-if, dg-excess-errors.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161089 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fixincludes')
-rw-r--r-- | fixincludes/ChangeLog | 7 | ||||
-rw-r--r-- | fixincludes/fixincl.x | 96 | ||||
-rw-r--r-- | fixincludes/inclhack.def | 34 | ||||
-rw-r--r-- | fixincludes/tests/base/complex.h | 10 | ||||
-rw-r--r-- | fixincludes/tests/base/sys/feature_tests.h | 18 |
5 files changed, 160 insertions, 5 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index 274d0039723..11c4e695ea1 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,10 @@ +2010-06-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * inclhack.def (solaris__restrict, solaris_complex_cxx): New fixes + * fixincl.x: Regenerate. + * tests/base/complex.h [SOLARIS_COMPLEX_CXX_CHECK]: New test. + * tests/base/sys/feature_tests.h: New file. + 2010-06-03 Joern Rennecke <joern.rennecke@embecosm.com> Ralf Wildenhues <Ralf.Wildenhues@gmx.de> diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index e80d50c5adc..88ad8434020 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed Wednesday April 7, 2010 at 05:11:50 PM MEST + * It has been AutoGen-ed Friday May 7, 2010 at 02:41:29 PM MEST * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Wed Apr 7 17:11:50 MEST 2010 +/* DO NOT SVN-MERGE THIS FILE, EITHER Fri May 7 14:41:29 MEST 2010 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 205 fixup descriptions. + * This file contains 207 fixup descriptions. * * See README for more information. * @@ -6116,6 +6116,47 @@ static const char* apzRs6000_ParamPatch[] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Solaris___Restrict fix + */ +tSCC zSolaris___RestrictName[] = + "solaris___restrict"; + +/* + * File name selection pattern + */ +tSCC zSolaris___RestrictList[] = + "sys/feature_tests.h\0"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzSolaris___RestrictMachs[] = { + "*-*-solaris2*", + (const char*)NULL }; + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris___RestrictSelect0[] = + "#define[ \t]*_RESTRICT_KYWD[ \t]*restrict"; + +#define SOLARIS___RESTRICT_TEST_CT 1 +static tTestDesc aSolaris___RestrictTests[] = { + { TT_EGREP, zSolaris___RestrictSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris___Restrict + */ +static const char* apzSolaris___RestrictPatch[] = { + "format", + "#ifdef __cplusplus\n\ +#define\t_RESTRICT_KYWD\t__restrict\n\ +#else\n\ +%0\n\ +#endif", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Solaris_Complex fix */ tSCC zSolaris_ComplexName[] = @@ -6155,6 +6196,39 @@ static const char* apzSolaris_ComplexPatch[] = { sed_cmd_z, /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Solaris_Complex_Cxx fix + */ +tSCC zSolaris_Complex_CxxName[] = + "solaris_complex_cxx"; + +/* + * File name selection pattern + */ +tSCC zSolaris_Complex_CxxList[] = + "complex.h\0"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzSolaris_Complex_CxxMachs[] = { + "*-*-solaris2.*", + (const char*)NULL }; +#define SOLARIS_COMPLEX_CXX_TEST_CT 0 +#define aSolaris_Complex_CxxTests (tTestDesc*)NULL + +/* + * Fix Command Arguments for Solaris_Complex_Cxx + */ +static const char* apzSolaris_Complex_CxxPatch[] = { sed_cmd_z, + "-e", "/#if[ \t]*!defined(__cplusplus)/c#ifdef\t__cplusplus\\\n\ +extern \"C\" {\\\n\ +#endif", + "-e", "/#endif[ \t]*\\/\\* !defined(__cplusplus) \\*\\//c#ifdef\t__cplusplus\\\n\ +}\\\n\ +#endif", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Solaris_Math_1 fix */ tSCC zSolaris_Math_1Name[] = @@ -8358,9 +8432,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 245 +#define REGEX_COUNT 246 #define MACH_LIST_SIZE_LIMIT 181 -#define FIX_COUNT 205 +#define FIX_COUNT 207 /* * Enumerate the fixes @@ -8516,7 +8590,9 @@ typedef enum { RS6000_DOUBLE_FIXIDX, RS6000_FCHMOD_FIXIDX, RS6000_PARAM_FIXIDX, + SOLARIS___RESTRICT_FIXIDX, SOLARIS_COMPLEX_FIXIDX, + SOLARIS_COMPLEX_CXX_FIXIDX, SOLARIS_MATH_1_FIXIDX, SOLARIS_MATH_2_FIXIDX, SOLARIS_MATH_3_FIXIDX, @@ -9324,11 +9400,21 @@ tFixDesc fixDescList[ FIX_COUNT ] = { RS6000_PARAM_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aRs6000_ParamTests, apzRs6000_ParamPatch, 0 }, + { zSolaris___RestrictName, zSolaris___RestrictList, + apzSolaris___RestrictMachs, + SOLARIS___RESTRICT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSolaris___RestrictTests, apzSolaris___RestrictPatch, 0 }, + { zSolaris_ComplexName, zSolaris_ComplexList, apzSolaris_ComplexMachs, SOLARIS_COMPLEX_TEST_CT, FD_MACH_ONLY, aSolaris_ComplexTests, apzSolaris_ComplexPatch, 0 }, + { zSolaris_Complex_CxxName, zSolaris_Complex_CxxList, + apzSolaris_Complex_CxxMachs, + SOLARIS_COMPLEX_CXX_TEST_CT, FD_MACH_ONLY, + aSolaris_Complex_CxxTests, apzSolaris_Complex_CxxPatch, 0 }, + { zSolaris_Math_1Name, zSolaris_Math_1List, apzSolaris_Math_1Machs, SOLARIS_MATH_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 4f70a9f3a64..16f36a1e74a 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -3249,6 +3249,23 @@ fix = { /* + * Solaris 10+ <sys/feature_tests.h> defines _RESTRICT_KYWD as restrict + * for C99. This is wrong for C++, which needs many C99 features, but + * only supports __restrict. + */ +fix = { + hackname = solaris___restrict; + files = sys/feature_tests.h; + select = "#define[ \t]*_RESTRICT_KYWD[ \t]*restrict"; + mach = "*-*-solaris2*"; + c_fix = format; + c_fix_arg = "#ifdef __cplusplus\n#define\t_RESTRICT_KYWD\t__restrict\n" + "#else\n%0\n#endif"; + test_text = "#define _RESTRICT_KYWD restrict"; +}; + + +/* * Solaris 10+ complex.h defines _Complex_I and _Imaginary_I in terms of * themselves, which are Sun Studio compiler intrinsics. Remove _Imaginary_I * and imaginary definitions which are not supported by GCC. @@ -3273,6 +3290,23 @@ fix = { /* + * Solaris 10+ <complex.h> is wrapped in #ifndef __cplusplus. Wrap in + * extern "C" instead so libstdc++ can use it. + */ +fix = { + hackname = solaris_complex_cxx; + mach = "*-*-solaris2.*"; + files = complex.h; + sed = "/#if[ \t]*!defined(__cplusplus)/c" + "#ifdef\t__cplusplus\\\nextern \"C\" {\\\n#endif"; + sed = "/#endif[ \t]*\\/\\* !defined(__cplusplus) \\*\\//c" + "#ifdef\t__cplusplus\\\n}\\\n#endif"; + test_text = "#if !defined(__cplusplus)\n" + "#endif /* !defined(__cplusplus) */"; +}; + + +/* * Sun Solaris 10 defines several C99 math macros in terms of * builtins specific to the Studio compiler, in particular not * compatible with the GNU compiler. diff --git a/fixincludes/tests/base/complex.h b/fixincludes/tests/base/complex.h index 9a54e8c0bda..b3fe27aca2e 100644 --- a/fixincludes/tests/base/complex.h +++ b/fixincludes/tests/base/complex.h @@ -33,3 +33,13 @@ #undef I #define I _Complex_I #endif /* SOLARIS_COMPLEX_CHECK */ + + +#if defined( SOLARIS_COMPLEX_CXX_CHECK ) +#ifdef __cplusplus +extern "C" { +#endif +#ifdef __cplusplus +} +#endif +#endif /* SOLARIS_COMPLEX_CXX_CHECK */ diff --git a/fixincludes/tests/base/sys/feature_tests.h b/fixincludes/tests/base/sys/feature_tests.h new file mode 100644 index 00000000000..3bb803c288d --- /dev/null +++ b/fixincludes/tests/base/sys/feature_tests.h @@ -0,0 +1,18 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/sys/feature_tests.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( SOLARIS___RESTRICT_CHECK ) +#ifdef __cplusplus +#define _RESTRICT_KYWD __restrict +#else +#define _RESTRICT_KYWD restrict +#endif +#endif /* SOLARIS___RESTRICT_CHECK */ |