diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2010-06-21 15:27:29 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2010-06-21 15:27:29 +0000 |
commit | babc47283189c5cae91cfe13fd20b0633145655c (patch) | |
tree | edfae00a397941520330c85dfbe0358fbc178307 /fixincludes/inclhack.def | |
parent | 602a7ec025a239f80d9857fc4c80dfd8b961910e (diff) | |
download | gcc-babc47283189c5cae91cfe13fd20b0633145655c.zip gcc-babc47283189c5cae91cfe13fd20b0633145655c.tar.gz gcc-babc47283189c5cae91cfe13fd20b0633145655c.tar.bz2 |
sol2.h (TARGET_OS_CPP_BUILTINS): Define __STDC_VERSION__=199901L, _XOPEN_SOURCE=600 for C++.
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.
From-SVN: r161089
Diffstat (limited to 'fixincludes/inclhack.def')
-rw-r--r-- | fixincludes/inclhack.def | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 4f70a9f..16f36a1 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. |