inclhack.def (alpha_assert): Fix assert macro in Tru64 UNIX assert.h.
authorRainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Thu, 21 Mar 2002 01:11:48 +0000 (01:11 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Thu, 21 Mar 2002 01:11:48 +0000 (01:11 +0000)
* fixinc/inclhack.def (alpha_assert): Fix assert macro in Tru64
UNIX assert.h.
* fixinc/fixincl.x: Regenerate.

From-SVN: r51106

gcc/ChangeLog
gcc/fixinc/fixincl.x
gcc/fixinc/inclhack.def

index 31e02a9334038de7053130928c0a97f63d5d6756..688fbbf3ba2a88c97e72c0947a85b68359f68070 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-21  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+       * fixinc/inclhack.def (alpha_assert): Fix assert macro in Tru64
+       UNIX assert.h.
+       * fixinc/fixincl.x: Regenerate.
+
 2002-03-20  Jason Merrill  <jason@redhat.com>
 
        * config/i386/cygwin.h (DWARF2_UNWIND_INFO): Define to 0.
index e2a2222125762956f7c6a823b3988fedca963c0d..280948df5588aa6697c3ac80d4429eb30b6b8fe9 100644 (file)
@@ -5,7 +5,7 @@
  * files which are fixed to work correctly with ANSI C and placed in a
  * directory that GNU C will search.
  *
- * This file contains 138 fixup descriptions.
+ * This file contains 139 fixup descriptions.
  *
  * See README for more information.
  *
@@ -742,6 +742,41 @@ static const char* apzAlpha___AssertPatch[] = {
     "__assert(const char *, const char *, int)",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Alpha_Assert fix
+ */
+tSCC zAlpha_AssertName[] =
+     "alpha_assert";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zAlpha_AssertList[] =
+  "|assert.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+#define apzAlpha_AssertMachs (const char**)NULL
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zAlpha_AssertSelect0[] =
+       "(#define assert\\(EX\\).*)\\(\\(int\\) \\(EX\\)\\)";
+
+#define    ALPHA_ASSERT_TEST_CT  1
+static tTestDesc aAlpha_AssertTests[] = {
+  { TT_EGREP,    zAlpha_AssertSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Alpha_Assert
+ */
+static const char* apzAlpha_AssertPatch[] = {
+    "format",
+    "%1(EX)",
+    (char*)NULL };
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
  *  Description of Alpha_Getopt fix
@@ -5435,9 +5470,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          147
+#define REGEX_COUNT          148
 #define MACH_LIST_SIZE_LIMIT 279
-#define FIX_COUNT            138
+#define FIX_COUNT            139
 
 /*
  *  Enumerate the fixes
@@ -5458,6 +5493,7 @@ typedef enum {
     AIX_SYSWAIT_FIXIDX,
     AIX_VOLATILE_FIXIDX,
     ALPHA___ASSERT_FIXIDX,
+    ALPHA_ASSERT_FIXIDX,
     ALPHA_GETOPT_FIXIDX,
     ALPHA_PARENS_FIXIDX,
     ALPHA_SBRK_FIXIDX,
@@ -5659,6 +5695,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      ALPHA___ASSERT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aAlpha___AssertTests,   apzAlpha___AssertPatch, 0 },
 
+  {  zAlpha_AssertName,    zAlpha_AssertList,
+     apzAlpha_AssertMachs,
+     ALPHA_ASSERT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aAlpha_AssertTests,   apzAlpha_AssertPatch, 0 },
+
   {  zAlpha_GetoptName,    zAlpha_GetoptList,
      apzAlpha_GetoptMachs,
      ALPHA_GETOPT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
index d322d2f1e55f90d490c20cdf72ef5cf1ce7e809d..874f58495d079dde15dc2971e6d4e05152a5a633 100644 (file)
@@ -585,6 +585,20 @@ fix = {
 };
 
 
+/*
+ *  Fix assert macro in assert.h on Alpha OSF/1.
+ *  The superfluous int cast breaks C++.
+ */
+fix = {
+    hackname  = alpha_assert;
+    files     = "assert.h";
+    select    = '(#define assert\(EX\).*)\(\(int\) \(EX\)\)';
+    c_fix     = format;
+    c_fix_arg = "%1(EX)";
+    test_text = '#define assert(EX) (((int) (EX)) ? (void)0 : __assert(#EX, __FILE__, __LINE__))';
+};
+
+
 /*
  *  Fix getopt declarations in stdio.h and stdlib.h on Alpha OSF/1 and AIX.
  */