]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
inclhack.def (svr4_undeclared_getrnge): Introduce and enable.
authorNathanael Nerode <neroden@gcc.gnu.org>
Mon, 4 Aug 2003 19:30:11 +0000 (19:30 +0000)
committerNathanael Nerode <neroden@gcc.gnu.org>
Mon, 4 Aug 2003 19:30:11 +0000 (19:30 +0000)
* fixinc/inclhack.def (svr4_undeclared_getrnge): Introduce and enable.
* fixinc/inclhack.def (static_getrnge): Remove disabled hack.
* fixinc/fixincl.x: Rebuild.
* fixinc/tests/base/regexp.h: New test.

From-SVN: r70153

gcc/ChangeLog
gcc/fixinc/fixincl.x
gcc/fixinc/inclhack.def
gcc/fixinc/tests/base/regexp.h [new file with mode: 0644]

index cad36c32a62733016cccd0e530131803b4904fdf..583b6fcc9138f2dd51b1498ad395368ebbdc9457 100644 (file)
@@ -1,3 +1,10 @@
+2003-08-04  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+       * fixinc/inclhack.def (svr4_undeclared_getrnge): Introduce and enable.
+       * fixinc/inclhack.def (static_getrnge): Remove disabled hack.
+       * fixinc/fixincl.x: Rebuild.
+       * fixinc/tests/base/regexp.h: New test.
+
 2003-08-04  Alexandre Oliva  <aoliva@redhat.com>
 
        * c-ppoutput.c (cb_line_change): Don't skip line changing while
index 5522a55b349661482367591343cdc4021a0fb9f1..46741b90ccc7cae94d1cd3c07db862d75e14791b 100644 (file)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Friday August  1, 2003 at 06:47:22 PM EDT
+ * It has been AutoGen-ed  Monday August  4, 2003 at 03:26:31 PM EDT
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT CVS-MERGE THIS FILE, EITHER Fri Aug  1 18:47:22 EDT 2003
+/* DO NOT CVS-MERGE THIS FILE, EITHER Mon Aug  4 15:26:31 EDT 2003
  *
  * 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 155 fixup descriptions.
+ * This file contains 156 fixup descriptions.
  *
  * See README for more information.
  *
@@ -4937,6 +4937,50 @@ static const char* apzSvr4_ProfilPatch[] = {
     "profil(unsigned short *, size_t, int, unsigned int)",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Svr4_Undeclared_Getrnge fix
+ */
+tSCC zSvr4_Undeclared_GetrngeName[] =
+     "svr4_undeclared_getrnge";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zSvr4_Undeclared_GetrngeList[] =
+  "|regexp.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+#define apzSvr4_Undeclared_GetrngeMachs (const char**)NULL
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zSvr4_Undeclared_GetrngeSelect0[] =
+       "getrnge";
+
+/*
+ *  content bypass pattern - skip fix if pattern found
+ */
+tSCC zSvr4_Undeclared_GetrngeBypass0[] =
+       "static void getrnge";
+
+#define    SVR4_UNDECLARED_GETRNGE_TEST_CT  2
+static tTestDesc aSvr4_Undeclared_GetrngeTests[] = {
+  { TT_NEGREP,   zSvr4_Undeclared_GetrngeBypass0, (regex_t*)NULL },
+  { TT_EGREP,    zSvr4_Undeclared_GetrngeSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Svr4_Undeclared_Getrnge
+ */
+static const char* apzSvr4_Undeclared_GetrngePatch[] = {
+    "format",
+    "%0\n\
+static int getrnge ();",
+    "^static int[ \t]+size;",
+    (char*)NULL };
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
  *  Description of Sysv68_String fix
@@ -6149,9 +6193,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          174
+#define REGEX_COUNT          176
 #define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT            155
+#define FIX_COUNT            156
 
 /*
  *  Enumerate the fixes
@@ -6280,6 +6324,7 @@ typedef enum {
     SVR4_DISABLE_OPT_FIXIDX,
     SVR4_GETCWD_FIXIDX,
     SVR4_PROFIL_FIXIDX,
+    SVR4_UNDECLARED_GETRNGE_FIXIDX,
     SYSV68_STRING_FIXIDX,
     SYSZ_STDLIB_FOR_SUN_FIXIDX,
     THREAD_KEYWORD_FIXIDX,
@@ -6930,6 +6975,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      SVR4_PROFIL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aSvr4_ProfilTests,   apzSvr4_ProfilPatch, 0 },
 
+  {  zSvr4_Undeclared_GetrngeName,    zSvr4_Undeclared_GetrngeList,
+     apzSvr4_Undeclared_GetrngeMachs,
+     SVR4_UNDECLARED_GETRNGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aSvr4_Undeclared_GetrngeTests,   apzSvr4_Undeclared_GetrngePatch, 0 },
+
   {  zSysv68_StringName,    zSysv68_StringList,
      apzSysv68_StringMachs,
      SYSV68_STRING_TEST_CT, FD_MACH_ONLY,
index 7c5922b174224ffaa0e52219a038955613b4577f..c342f92a3eb1d682acf514553e67434237cf8e5a 100644 (file)
@@ -2304,25 +2304,6 @@ fix = {
 };
 
 
-/*
- *  Add a `static' declaration of `getrnge' into <regexp.h>.
- *
- *  Don't do this if there is already a `static void getrnge' declaration
- *  present, since this would cause a redeclaration error.  Solaris 2.x has
- *  such a declaration.
- */
-#ifdef SVR4
-fix = {
-    hackname = static_getrnge;
-    files    = regexp.h;
-    bypass   = "static void getrnge";
-    sed      = "/^static int[ \t]*size;/c\\\n"
-               "static int      size ;\\\n\\\n"
-               "static int getrnge ();";
-};
-#endif
-
-
 /*
  *  a missing semi-colon at the end of the statsswtch structure definition.
  */
@@ -2989,6 +2970,35 @@ fix = {
 #endif
 
 
+/*
+ *  Some SysV r4 systems, including Sequent's DYNIX/ptx, use the local
+ *  function 'getrnge' in <regexp.h> before they declare it.  For these
+ *  systems add a 'static int' declaration of 'getrnge' into <regexp.h>
+ *  early on.
+ *
+ *  'getrnge' traditionally manipulates a file-scope global called 'size',
+ *  so put the declaration right after the declaration of 'size'.
+ *
+ *  Don't do this if there is already a `static void getrnge' declaration
+ *  present, since this would cause a redeclaration error.  Solaris 2.x has
+ *  such a declaration.
+ */
+fix = {
+    hackname  = svr4_undeclared_getrnge;
+    files     = regexp.h;
+    select    = "getrnge";
+    bypass    = "static void getrnge";
+    c_fix     = format;
+    c_fix_arg = "%0\n"
+                "static int getrnge ();";
+    c_fix_arg = "^static int[ \t]+size;";
+    test_text = "static int size;\n"
+                "/* stuff which calls getrnge() */\n"
+                "static getrnge()\n"
+                "{}";
+};
+
+
 /*
  *  Like svr4_mach_defines, but with newfangled syntax.
  *  Source lines are of #define __i386 #machine(i386).   Delete them.
diff --git a/gcc/fixinc/tests/base/regexp.h b/gcc/fixinc/tests/base/regexp.h
new file mode 100644 (file)
index 0000000..35ec049
--- /dev/null
@@ -0,0 +1,18 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+       "fixinc/tests/inc/regexp.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+
+
+#if defined( SVR4_UNDECLARED_GETRNGE_CHECK )
+static int size;
+static int getrnge ();
+/* stuff which calls getrnge() */
+static getrnge()
+{}
+#endif  /* SVR4_UNDECLARED_GETRNGE_CHECK */