This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: fixinc/inclhack.def for UnixWare 2.1.3




This patch "works for me" on i586-pc-linux-gnu

Index: gcc/fixinc/inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.101.2.17
diff -u -r1.101.2.17 inclhack.def
--- inclhack.def        2001/12/06 21:48:30     1.101.2.17
+++ inclhack.def        2001/12/12 02:51:56
@@ -2243,12 +2243,11 @@
                "(!__STDC__"
                "|__STDC__[ \t]*==[ \t]*0"
                "|__STDC__[ \t]*!=[ \t]*1"
-               "|__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0"
-               ")(.*)";
+               "|__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0)";
     c_test   = stdc_0_in_system_headers;
 
     c_fix     = format;
-    c_fix_arg = "%1 !defined(__STRICT_ANSI__)%3";
+    c_fix_arg = "%1 !defined(__STRICT_ANSI__)";
 
     test_text = "#if !__STDC__ \n"
                 "#if __STDC__ == 0\n"
@@ -2265,18 +2264,22 @@
 fix = {
     hackname = strict_ansi_not_ctd;
     files    = math.h, limits.h, stdio.h, signal.h, stdlib.h, time.h;
-    select   = "^([ \t]*[|&][|&][ \t(]*)"
-               "(__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0"
-               ")(.*)";
+    select   = "^([ \t]*[|&][|&]"
+               "([ \t(]*!*[ \t]*defined\\([a-zA-Z_0-9]+\\)[ \t]*[|&][|&])*"
+               "[ \t(]*)"
+               "(__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0)";
     c_test   = stdc_0_in_system_headers;
 
     c_fix     = format;
-    c_fix_arg = "%1 !defined(__STRICT_ANSI__)%3";
+    c_fix_arg = "%1 !defined(__STRICT_ANSI__)";
 
-    test_text = "#if 1\\\n"
-               "|| __STDC__ - 0 == 0 /* not std C */\nint foo;\n#endif";
+    test_text = "#if 1 \\\\\n"
+               "&| defined(mumbling) |& (__STDC__ - 0 == 0) \\\\\n"
+               "|| __STDC__ - 0 == 0 /* not std C */\n"
+               "int foo;\n#endif";
 };
 
+
 /*
  *  "__STDC__!=0" or "__STDC__==1" or "__STDC__-0==1"
  *  is "defined( __STRICT_ANSI__ )"
@@ -2287,12 +2290,11 @@
                "(__STDC__[ \t]*!=[ \t]*0"
                "|__STDC__[ \t]*==[ \t]*1"
                "|__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*1"
-               "|__STDC__[ \t]*-[ \t]*0[ \t]*!=[ \t]*0"
-               ")(.*)";
+               "|__STDC__[ \t]*-[ \t]*0[ \t]*!=[ \t]*0)";
     c_test   = stdc_0_in_system_headers;
 
     c_fix     = format;
-    c_fix_arg = "%1 defined(__STRICT_ANSI__)%3";
+    c_fix_arg = "%1 defined(__STRICT_ANSI__)";
 
     test_text = "#if __STDC__ == 1 /* is std C\n */\nint foo;\n#endif";
 };
Index: gcc/fixinc/tests/base/math.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/tests/base/math.h,v
retrieving revision 1.5.6.2
diff -u -r1.5.6.2 math.h
--- math.h      2001/07/20 03:39:03     1.5.6.2
+++ math.h      2001/12/12 02:51:57
@@ -105,7 +105,9 @@
 
 
 #if defined( STRICT_ANSI_NOT_CTD_CHECK )
-#if 1||  !defined(__STRICT_ANSI__) /* not std C */
+#if 1 \
+&| defined(mumbling) |& ( !defined(__STRICT_ANSI__)) \
+||  !defined(__STRICT_ANSI__) /* not std C */
 int foo;
 #endif
 #endif  /* STRICT_ANSI_NOT_CTD_CHECK */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]