OSDN Git Service

* inclhack.def (darwin_externc): New.
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Oct 2007 23:22:02 +0000 (23:22 +0000)
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Oct 2007 23:22:02 +0000 (23:22 +0000)
* fixincl.x: Regenerate.
* tests/base/mach-o/swap.h: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129188 138bc75d-0d04-0410-961f-82ee72b054a4

fixincludes/ChangeLog
fixincludes/fixincl.x
fixincludes/inclhack.def
fixincludes/tests/base/mach-o/swap.h [new file with mode: 0644]

index 44a2c11..79b8fcc 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-09  Geoffrey Keating  <geoffk@apple.com>
+
+       * inclhack.def (darwin_externc): New.
+       * fixincl.x: Regenerate.
+       * tests/base/mach-o/swap.h: New.
+
 2007-08-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * inclhack.def (solaris_math_5, solaris_math_6, solaris_math_7):
 2007-08-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * inclhack.def (solaris_math_5, solaris_math_6, solaris_math_7):
index 93f2ae0..599bb21 100644 (file)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Friday August  3, 2007 at 09:50:46 PM EDT
+ * It has been AutoGen-ed  Monday October  8, 2007 at 12:36:37 PM PDT
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT SVN-MERGE THIS FILE, EITHER Fri Aug  3 21:50:46 EDT 2007
+/* DO NOT SVN-MERGE THIS FILE, EITHER Mon Oct  8 12:36:37 PDT 2007
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
  *
  * 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.
  *
  * 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 208 fixup descriptions.
+ * This file contains 209 fixup descriptions.
  *
  * See README for more information.
  *
  *
  * See README for more information.
  *
@@ -1879,6 +1879,51 @@ extern \"C\" {\n\
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
+ *  Description of Darwin_Externc fix
+ */
+tSCC zDarwin_ExterncName[] =
+     "darwin_externc";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zDarwin_ExterncList[] =
+  "mach-o/swap.h\0mach/mach_time.h\0mach/mach_traps.h\0mach/message.h\0mach/mig.h\0mach/semaphore.h\0";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_ExterncMachs[] = {
+        "*-*-darwin*",
+        (const char*)NULL };
+
+/*
+ *  content bypass pattern - skip fix if pattern found
+ */
+tSCC zDarwin_ExterncBypass0[] =
+       "extern \"C\"";
+tSCC zDarwin_ExterncBypass1[] =
+       "__BEGIN_DECLS";
+
+#define    DARWIN_EXTERNC_TEST_CT  2
+static tTestDesc aDarwin_ExterncTests[] = {
+  { TT_NEGREP,   zDarwin_ExterncBypass0, (regex_t*)NULL },
+  { TT_NEGREP,   zDarwin_ExterncBypass1, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Darwin_Externc
+ */
+static const char* apzDarwin_ExterncPatch[] = {
+    "wrap",
+    "#ifdef __cplusplus\n\
+extern \"C\" {\n\
+#endif\n",
+    "#ifdef __cplusplus\n\
+}\n\
+#endif\n",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
  *  Description of Darwin_Gcc4_Breakage fix
  */
 tSCC zDarwin_Gcc4_BreakageName[] =
  *  Description of Darwin_Gcc4_Breakage fix
  */
 tSCC zDarwin_Gcc4_BreakageName[] =
@@ -8456,9 +8501,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          250
+#define REGEX_COUNT          252
 #define MACH_LIST_SIZE_LIMIT 261
 #define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT            208
+#define FIX_COUNT            209
 
 /*
  *  Enumerate the fixes
 
 /*
  *  Enumerate the fixes
@@ -8506,6 +8551,7 @@ typedef enum {
     CTRL_QUOTES_DEF_FIXIDX,
     CTRL_QUOTES_USE_FIXIDX,
     CXX_UNREADY_FIXIDX,
     CTRL_QUOTES_DEF_FIXIDX,
     CTRL_QUOTES_USE_FIXIDX,
     CXX_UNREADY_FIXIDX,
+    DARWIN_EXTERNC_FIXIDX,
     DARWIN_GCC4_BREAKAGE_FIXIDX,
     DARWIN_PRIVATE_EXTERN_FIXIDX,
     DEC_INTERN_ASM_FIXIDX,
     DARWIN_GCC4_BREAKAGE_FIXIDX,
     DARWIN_PRIVATE_EXTERN_FIXIDX,
     DEC_INTERN_ASM_FIXIDX,
@@ -8885,6 +8931,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      CXX_UNREADY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aCxx_UnreadyTests,   apzCxx_UnreadyPatch, 0 },
 
      CXX_UNREADY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aCxx_UnreadyTests,   apzCxx_UnreadyPatch, 0 },
 
+  {  zDarwin_ExterncName,    zDarwin_ExterncList,
+     apzDarwin_ExterncMachs,
+     DARWIN_EXTERNC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aDarwin_ExterncTests,   apzDarwin_ExterncPatch, 0 },
+
   {  zDarwin_Gcc4_BreakageName,    zDarwin_Gcc4_BreakageList,
      apzDarwin_Gcc4_BreakageMachs,
      DARWIN_GCC4_BREAKAGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
   {  zDarwin_Gcc4_BreakageName,    zDarwin_Gcc4_BreakageList,
      apzDarwin_Gcc4_BreakageMachs,
      DARWIN_GCC4_BREAKAGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
index fde0816..08989c9 100644 (file)
@@ -1167,6 +1167,32 @@ fix = {
 
 
 /*
 
 
 /*
+ *  On darwin8 and earlier, mach-o/swap.h isn't properly guarded
+ *  by 'extern "C"'.  On darwin7 some mach/ headers aren't properly guarded.
+ */
+fix = {
+  hackname  = darwin_externc;
+  mach      = "*-*-darwin*";
+  files     = mach-o/swap.h;
+  files     = mach/mach_time.h;
+  files     = mach/mach_traps.h;
+  files     = mach/message.h;
+  files     = mach/mig.h;
+  files     = mach/semaphore.h;
+  bypass    = "extern \"C\"";
+  bypass    = "__BEGIN_DECLS";
+  c_fix     = wrap;
+  c_fix_arg = "#ifdef __cplusplus\n"
+              "extern \"C\" {\n"
+              "#endif\n";
+  c_fix_arg = "#ifdef __cplusplus\n"
+              "}\n"
+              "#endif\n";
+  test_text = "extern void swap_fat_header();\n";
+};
+
+
+/*
  * AvailabilityMacros.h on Darwin breaks with GCC 4.0, because of
  * bad __GNUC__ tests.
  */
  * AvailabilityMacros.h on Darwin breaks with GCC 4.0, because of
  * bad __GNUC__ tests.
  */
diff --git a/fixincludes/tests/base/mach-o/swap.h b/fixincludes/tests/base/mach-o/swap.h
new file mode 100644 (file)
index 0000000..1bc65d4
--- /dev/null
@@ -0,0 +1,26 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+       "fixinc/tests/inc/mach-o/swap.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+#ifndef FIXINC_WRAP_MACH_O_SWAP_H_DARWIN_EXTERNC
+#define FIXINC_WRAP_MACH_O_SWAP_H_DARWIN_EXTERNC 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if defined( DARWIN_EXTERNC_CHECK )
+extern void swap_fat_header();
+
+#endif  /* DARWIN_EXTERNC_CHECK */
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* FIXINC_WRAP_MACH_O_SWAP_H_DARWIN_EXTERNC */