]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
inclhack.def (darwin_externc): New.
authorGeoffrey Keating <geoffk@apple.com>
Tue, 9 Oct 2007 23:22:02 +0000 (23:22 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Tue, 9 Oct 2007 23:22:02 +0000 (23:22 +0000)
* inclhack.def (darwin_externc): New.
* fixincl.x: Regenerate.
* tests/base/mach-o/swap.h: New.

From-SVN: r129188

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

index 44a2c1176744ffbf9014cc6d2fe31d56129b66d1..79b8fccbc74908ec8a570ade52a5870b2c6c2b34 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):
index 93f2ae087259be6d3a9d7c4d89978b9c11bef9a5..599bb21d8a33324acd1621e48aa401e0e75fb268 100644 (file)
@@ -2,11 +2,11 @@
  * 
  * 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
  */
-/* 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.
  *
@@ -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 208 fixup descriptions.
+ * This file contains 209 fixup descriptions.
  *
  * See README for more information.
  *
@@ -1877,6 +1877,51 @@ extern \"C\" {\n\
 #endif\n",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  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
@@ -8456,9 +8501,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          250
+#define REGEX_COUNT          252
 #define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT            208
+#define FIX_COUNT            209
 
 /*
  *  Enumerate the fixes
@@ -8506,6 +8551,7 @@ typedef enum {
     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,
@@ -8885,6 +8931,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      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,
index fde081652fe263e85eb94324d5b45327f414e8b6..08989c9e750c02e6f37e506c8ac4ae0a31508e5c 100644 (file)
@@ -1166,6 +1166,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.
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 */