summaryrefslogtreecommitdiff
path: root/fixincludes/inclhack.def
diff options
context:
space:
mode:
authorro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-21 15:27:29 +0000
committerro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-21 15:27:29 +0000
commita6905708d86d6c2d8560168ac5accb816a2038c8 (patch)
treeedfae00a397941520330c85dfbe0358fbc178307 /fixincludes/inclhack.def
parentbbc7bed2e0ba2c1533a3263f4b7057b0b03c6fa3 (diff)
downloadgcc-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/inclhack.def')
-rw-r--r--fixincludes/inclhack.def34
1 files changed, 34 insertions, 0 deletions
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.