sol2.h (TARGET_OS_CPP_BUILTINS): Define __STDC_VERSION__=199901L, _XOPEN_SOURCE=600...
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Mon, 21 Jun 2010 15:27:29 +0000 (15:27 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Mon, 21 Jun 2010 15:27:29 +0000 (15:27 +0000)
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

fixincludes/ChangeLog
fixincludes/fixincl.x
fixincludes/inclhack.def
fixincludes/tests/base/complex.h
fixincludes/tests/base/sys/feature_tests.h [new file with mode: 0644]
gcc/ChangeLog
gcc/config/sol2.h
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc

index 274d0039723db663440901b132307d11f75e96ee..11c4e695ea1ff19e2579acf530c78ecca8ccde05 100644 (file)
@@ -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>
 
index e80d50c5adcc7ac3dfaa80ca00430fc0946da3e2..88ad8434020a44c8632dd095f5ceecc8c9518a66 100644 (file)
@@ -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.
  *
@@ -6114,6 +6114,47 @@ static const char* apzRs6000_ParamPatch[] = {
     "rename(const char *_old, const char *_new)",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  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
@@ -6153,6 +6194,39 @@ static const char* apzSolaris_ComplexPatch[] = { sed_cmd_z,
     "-e", "s/#define[ \t]I[ \t]\\{1,\\}_Imaginary_I/#define\tI\t\t_Complex_I/",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  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
@@ -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,
index 4f70a9f3a6401e704731253b457ef2231e43eabc..16f36a1e74abd6d7f7084f35eca70ea2ae5e9202 100644 (file)
@@ -3248,6 +3248,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
@@ -3272,6 +3289,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
index 9a54e8c0bda65669a866e99f70885d78db1637e4..b3fe27aca2eabe265a1141841a02b73af967f957 100644 (file)
 #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 (file)
index 0000000..3bb803c
--- /dev/null
@@ -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 */
index 0a73e940e23980bb5c60b7a8d9535d0346073f0f..68bb4f0aa61bfb2fd8d496e5228ea9c42222e6d8 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * config/sol2.h (TARGET_OS_CPP_BUILTINS): Define
+       __STDC_VERSION__=199901L, _XOPEN_SOURCE=600 for C++.
+
 2010-06-21  Nick Clifton  <nickc@redhat.com>
 
        * config/rx/rx.h (PTRDIFF_TYPE): Define.
index 98e54e6a92c734aacba67d9b81041a88bbc4d119..7b7ce2bfbab2a2a458d43d03f8808cd5ee0e8b94 100644 (file)
@@ -99,7 +99,8 @@ along with GCC; see the file COPYING3.  If not see
           library.  */                                 \
        if (c_dialect_cxx ())                           \
          {                                             \
-           builtin_define ("_XOPEN_SOURCE=500");       \
+           builtin_define ("__STDC_VERSION__=199901L");\
+           builtin_define ("_XOPEN_SOURCE=600");       \
            builtin_define ("_LARGEFILE_SOURCE=1");     \
            builtin_define ("_LARGEFILE64_SOURCE=1");   \
            builtin_define ("__EXTENSIONS__");          \
index 2d9791587110d79b336ba477cc748a8c0c34e81a..332c22f28acd7cb137d54af06e3b01d6617c74c9 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc:
+       Add *-*-solaris2.1[0-9]* to dg-xfail-if, dg-excess-errors.
+
 2010-06-20  Paolo Carlini  <paolo.carlini@oracle.com>
            Kai-Uwe Bux  <bux@kubux.net>
 
index 142e1da38bd11c6f0ce0aa1ef9ff70eeeb04d99a..716dda51b1efb93ac1c5d64d69bfb97d57bec4c7 100644 (file)
@@ -20,8 +20,8 @@
 // { dg-do compile }
 // { dg-add-options no_pch }
 
-// { dg-xfail-if "" { { *-*-linux* *-*-darwin* hppa*-*-hpux* } || { uclibc || newlib } } { "*" } { "" } }
-// { dg-excess-errors "" { target { { *-*-linux* *-*-darwin* hppa*-*-hpux* } || { uclibc || newlib } } } }
+// { dg-xfail-if "" { { *-*-linux* *-*-darwin* *-*-solaris2.1[0-9]* hppa*-*-hpux* } || { uclibc || newlib } } { "*" } { "" } }
+// { dg-excess-errors "" { target { { *-*-linux* *-*-darwin* *-*-solaris2.1[0-9]* hppa*-*-hpux* } || { uclibc || newlib } } } }
 
 #include <math.h>