]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: inclhack.def (aix_assert): New fix.
authorDavid Edelsohn <dje.gcc@gmail.com>
Sat, 13 Dec 2014 17:47:30 +0000 (17:47 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Sat, 13 Dec 2014 17:47:30 +0000 (12:47 -0500)
Backport
2013-09-02  David Edelsohn  <dje.gcc@gmail.com>

        * inclhack.def (aix_assert): New fix.
        * fixincl.x: Regenerate.
        * tests/base/assert.h [AIX_ASSERT_CHECK]: New check.

From-SVN: r218708

fixincludes/ChangeLog
fixincludes/fixincl.x
fixincludes/inclhack.def
fixincludes/tests/base/assert.h

index 89ee2d309b45d1d255744b7b180dcf3d702c8459..68802d9c307daf79df739bc95d28e117bc0aeea4 100644 (file)
@@ -1,3 +1,12 @@
+2014-12-13  David Edelsohn  <dje.gcc@gmail.com>
+
+       Backport from mainline:
+       2013-09-02  David Edelsohn  <dje.gcc@gmail.com>
+
+       * inclhack.def (aix_assert): New fix.
+       * fixincl.x: Regenerate.
+       * tests/base/assert.h [AIX_ASSERT_CHECK]: New check.
+
 2014-05-22  Release Manager
 
        * GCC 4.8.3 released.
index e28a84267fe0cb63fc90fcd3a8bf24c7e879061b..ad324a386062ebbd6cd1494b77c554a85efa52f6 100644 (file)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Thursday May 16, 2013 at 03:34:25 PM MEST
+ * It has been AutoGen-ed  December 13, 2014 at 05:31:32 AM by AutoGen 5.12
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT SVN-MERGE THIS FILE, EITHER Thu May 16 15:34:25 MEST 2013
+/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Dec 13 05:31:32 PST 2014
  *
  * 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 226 fixup descriptions.
+ * This file contains 227 fixup descriptions.
  *
  * See README for more information.
  *
@@ -734,6 +734,45 @@ static const char* apzAab_Vxworks_UnistdPatch[] = {
 #endif /* _UNISTD_H */",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Aix_Assert fix
+ */
+tSCC zAix_AssertName[] =
+     "aix_assert";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zAix_AssertList[] =
+  "assert.h\0";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzAix_AssertMachs[] = {
+        "*-*-aix*",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zAix_AssertSelect0[] =
+       "#define[ \t]static_assert[ \t]_Static_assert";
+
+#define    AIX_ASSERT_TEST_CT  1
+static tTestDesc aAix_AssertTests[] = {
+  { TT_EGREP,    zAix_AssertSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Aix_Assert
+ */
+static const char* apzAix_AssertPatch[] = {
+    "format",
+    "#ifndef __cplusplus\n\
+%0\n\
+#endif",
+    (char*)NULL };
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
  *  Description of Aix_Complex fix
@@ -9265,9 +9304,9 @@ static const char* apzFeraiseexcept_Nosse_DivbyzeroPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          264
+#define REGEX_COUNT          265
 #define MACH_LIST_SIZE_LIMIT 187
-#define FIX_COUNT            226
+#define FIX_COUNT            227
 
 /*
  *  Enumerate the fixes
@@ -9285,6 +9324,7 @@ typedef enum {
     AAB_VXWORKS_REGS_VXTYPES_FIXIDX,
     AAB_VXWORKS_STDINT_FIXIDX,
     AAB_VXWORKS_UNISTD_FIXIDX,
+    AIX_ASSERT_FIXIDX,
     AIX_COMPLEX_FIXIDX,
     AIX_MALLOC_FIXIDX,
     AIX_NET_IF_ARP_FIXIDX,
@@ -9562,6 +9602,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      AAB_VXWORKS_UNISTD_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
      aAab_Vxworks_UnistdTests,   apzAab_Vxworks_UnistdPatch, 0 },
 
+  {  zAix_AssertName,    zAix_AssertList,
+     apzAix_AssertMachs,
+     AIX_ASSERT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aAix_AssertTests,   apzAix_AssertPatch, 0 },
+
   {  zAix_ComplexName,    zAix_ComplexList,
      apzAix_ComplexMachs,
      AIX_COMPLEX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
index 8648e57aabffbd1b410473d66a187799a0e6442d..66d4f2b7315360fe40285c321ec14113cb8d2b35 100644 (file)
@@ -574,6 +574,19 @@ fix = {
        _EndOfHeader_;
 };
 
+/*
+ * assert.h on AIX 7 redefines static_assert as _Static_assert without
+ * protecting C++.
+ */
+fix = {
+    hackname  = aix_assert;
+    mach      = "*-*-aix*";
+    files     = assert.h;
+    select    = "#define[ \t]static_assert[ \t]_Static_assert";
+    c_fix     = format;
+    c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
+    test_text = "#define static_assert _Static_assert";
+};
 
 /*
  * complex.h on AIX 5 and AIX 6 define _Complex_I and I in terms of __I,
index 2642cbe49c4bf1fe969adb46a2f9f9752f48254a..19dc52575ee15ec8876d3809667204cb1a6476ea 100644 (file)
 #include <stdio.h>
 
 
+#if defined( AIX_ASSERT_CHECK )
+#ifndef __cplusplus
+#define static_assert _Static_assert
+#endif
+#endif  /* AIX_ASSERT_CHECK */
+
+
 #if defined( ALPHA___ASSERT_CHECK )
 extern void __assert(const char *, const char *, int);
 #endif  /* ALPHA___ASSERT_CHECK */