]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
inclhack.def (bsd_stdio_attrs_conflict): New.
authorLoren J. Rittle <ljrittle@acm.org>
Fri, 4 Apr 2003 21:46:49 +0000 (21:46 +0000)
committerLoren J. Rittle <ljrittle@gcc.gnu.org>
Fri, 4 Apr 2003 21:46:49 +0000 (21:46 +0000)
* fixinc/inclhack.def (bsd_stdio_attrs_conflict): New.
* fixinc/fixincl.x: Rebuilt.
* fixinc/tests/base/stdio.h: Regenerated.

From-SVN: r65248

gcc/ChangeLog
gcc/fixinc/fixincl.x
gcc/fixinc/inclhack.def
gcc/fixinc/tests/base/stdio.h

index 822d403f6c0991c555113f1549f15eaf55e13358..c15b2c255e9a94b3c1f4576489a899b838c869a2 100644 (file)
@@ -1,3 +1,9 @@
+2003-04-04  Loren James Rittle  <ljrittle@acm.org>
+
+       * fixinc/inclhack.def (bsd_stdio_attrs_conflict): New.
+       * fixinc/fixincl.x: Rebuilt.
+       * fixinc/tests/base/stdio.h: Regenerated.
+
 2003-04-04  Nathan Sidwell  <nathan@codesourcery.com>
 
        * gcov.c (accumulate_line_counts): Fix span tree merge bug.
index fd9d3311e5513f2214d5fe308c4e47fadda7c93b..8391b416e9e899f5cafc7c7bfa71bfe347f4eec1 100644 (file)
@@ -1115,6 +1115,46 @@ static const char* apzBadquotePatch[] = {
     "does not",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Bsd_Stdio_Attrs_Conflict fix
+ */
+tSCC zBsd_Stdio_Attrs_ConflictName[] =
+     "bsd_stdio_attrs_conflict";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zBsd_Stdio_Attrs_ConflictList[] =
+  "|stdio.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzBsd_Stdio_Attrs_ConflictMachs[] = {
+        "*-*-*bsd*",
+        "*-*-*darwin*",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zBsd_Stdio_Attrs_ConflictSelect0[] =
+       "^#define[ \t]*vfscanf[ \t]*__svfscanf[ \t]*$";
+
+#define    BSD_STDIO_ATTRS_CONFLICT_TEST_CT  1
+static tTestDesc aBsd_Stdio_Attrs_ConflictTests[] = {
+  { TT_EGREP,    zBsd_Stdio_Attrs_ConflictSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Bsd_Stdio_Attrs_Conflict
+ */
+static const char* apzBsd_Stdio_Attrs_ConflictPatch[] = {
+    "format",
+    "#define _BSD_STRING(_BSD_X) _BSD_STRINGX(_BSD_X)\n\
+#define _BSD_STRINGX(_BSD_X) #_BSD_X\n\
+int vfscanf(FILE *, const char *, __builtin_va_list) __asm__ (_BSD_STRING(__USER_LABEL_PREFIX__) \"__svfscanf\");",
+    (char*)NULL };
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
  *  Description of Broken_Assert_Stdio fix
@@ -5871,6 +5911,7 @@ typedef enum {
     BAD_LVAL_FIXIDX,
     BAD_STRUCT_TERM_FIXIDX,
     BADQUOTE_FIXIDX,
+    BSD_STDIO_ATTRS_CONFLICT_FIXIDX,
     BROKEN_ASSERT_STDIO_FIXIDX,
     BROKEN_ASSERT_STDLIB_FIXIDX,
     BROKEN_CABS_FIXIDX,
@@ -6122,6 +6163,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      BADQUOTE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aBadquoteTests,   apzBadquotePatch, 0 },
 
+  {  zBsd_Stdio_Attrs_ConflictName,    zBsd_Stdio_Attrs_ConflictList,
+     apzBsd_Stdio_Attrs_ConflictMachs,
+     BSD_STDIO_ATTRS_CONFLICT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aBsd_Stdio_Attrs_ConflictTests,   apzBsd_Stdio_Attrs_ConflictPatch, 0 },
+
   {  zBroken_Assert_StdioName,    zBroken_Assert_StdioList,
      apzBroken_Assert_StdioMachs,
      BROKEN_ASSERT_STDIO_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
index 763df48270cdfcb4fd046a786ca9f046c27f4afe..525641231b53da9336eec3c69c89559a2ac6aec7 100644 (file)
@@ -723,6 +723,26 @@ fix = {
 };
 
 
+/*
+ *  Various systems derived from BSD4.4 contain a macro definition
+ *  for vfscanf that interacts badly with requirements of builtin-attrs.def.
+ *  Known to be fixed in FreeBSD 5 system headers.
+ */
+fix = {
+    hackname  = bsd_stdio_attrs_conflict;
+    mach      = *-*-*bsd*;
+    mach      = *-*-*darwin*;
+    files     = stdio.h;
+    select    = "^#define[ \t]*vfscanf[ \t]*__svfscanf[ \t]*$";
+    c_fix     = format;
+    c_fix_arg = '#define _BSD_STRING(_BSD_X) _BSD_STRINGX(_BSD_X)' "\n"
+               '#define _BSD_STRINGX(_BSD_X) #_BSD_X' "\n"
+               'int vfscanf(FILE *, const char *, __builtin_va_list) '
+               '__asm__ (_BSD_STRING(__USER_LABEL_PREFIX__) "__svfscanf");';
+    test_text = '#define  vfscanf      __svfscanf';
+};
+
+
 /*
  *  check for broken assert.h that needs stdio.h
  */
index bfa929fb6663dd6bbdc671f853c36dcb34aaf4b8..d0eadbc5c63b8b600a1bc60346f5fad3b00fcef4 100644 (file)
@@ -19,6 +19,13 @@ extern int getopt(int, char *const[], const char *);
 #endif  /* ALPHA_GETOPT_CHECK */
 
 
+#if defined( BSD_STDIO_ATTRS_CONFLICT_CHECK )
+#define _BSD_STRING(_BSD_X) _BSD_STRINGX(_BSD_X)
+#define _BSD_STRINGX(_BSD_X) #_BSD_X
+int vfscanf(FILE *, const char *, __builtin_va_list) __asm__ (_BSD_STRING(__USER_LABEL_PREFIX__) "__svfscanf");
+#endif  /* BSD_STDIO_ATTRS_CONFLICT_CHECK */
+
+
 #if defined( HPUX11_VSNPRINTF_CHECK )
 extern int vsnprintf(char *, _hpux_size_t, const char *, __gnuc_va_list);
 #endif  /* HPUX11_VSNPRINTF_CHECK */