]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* inclhack.def (aix_externc): New fix.
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 May 2015 17:25:00 +0000 (17:25 +0000)
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 May 2015 17:25:00 +0000 (17:25 +0000)
(aix_externcpp[12]): New fix.
* fixincl.x: Regenerate.
* test/base/ctype.h [AIX_EXTERNC_CHECK]: New test.
* test/base/sys/socket.h [AIX_EXTERNCPP[12]_CHECK]: New test.
* test/base/fcntl.h: New file.

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

fixincludes/ChangeLog
fixincludes/fixincl.x
fixincludes/inclhack.def
fixincludes/tests/base/ctype.h
fixincludes/tests/base/fcntl.h [new file with mode: 0644]
fixincludes/tests/base/sys/socket.h

index 8bab3f874249495c3312f533092d26ab4cd07a8e..4ac5138ebdc3d875cc16f89775be26168b917160 100644 (file)
@@ -1,3 +1,12 @@
+2015-05-21  David Edelsohn  <dje.gcc@gmail.com>
+
+       * inclhack.def (aix_externc): New fix.
+       (aix_externcpp[12]): New fix.
+       * fixincl.x: Regenerate.
+       * test/base/ctype.h [AIX_EXTERNC_CHECK]: New test.
+       * test/base/sys/socket.h [AIX_EXTERNCPP[12]_CHECK]: New test.
+       * test/base/fcntl.h: New file.
+
 2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
 
        * aclocal.m4: Regenerated with automake-1.11.6.
index 68bb9a8347b5f18cb483902b3e9f80678df5feea..d796014275e6d423c9c346bb8f155ed851636500 100644 (file)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Saturday March 28, 2015 at 01:24:12 PM EDT
+ * It has been AutoGen-ed  May 21, 2015 at 02:48:12 AM by AutoGen 5.18.3
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT SVN-MERGE THIS FILE, EITHER Sat 28 Mar 2015 13:24:12 EDT
+/* DO NOT SVN-MERGE THIS FILE, EITHER Thu May 21 02:48:12 UTC 2015
  *
  * 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 226 fixup descriptions.
+ * This file contains 229 fixup descriptions.
  *
  * See README for more information.
  *
@@ -810,6 +810,124 @@ static const char* apzAix_ComplexPatch[] = {
     "#define _Complex_I (__extension__ 1.0iF)",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Aix_Externc fix
+ */
+tSCC zAix_ExterncName[] =
+     "aix_externc";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zAix_ExterncList[] =
+  "ctype.h\0fcntl.h\0langinfo.h\0ldfcn.h\0sys/localedef.h\0sys/times.h\0";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzAix_ExterncMachs[] = {
+        "*-*-aix*",
+        (const char*)NULL };
+
+/*
+ *  content bypass pattern - skip fix if pattern found
+ */
+tSCC zAix_ExterncBypass0[] =
+       "extern \"C\"";
+
+#define    AIX_EXTERNC_TEST_CT  1
+static tTestDesc aAix_ExterncTests[] = {
+  { TT_NEGREP,   zAix_ExterncBypass0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Aix_Externc
+ */
+static const char* apzAix_ExterncPatch[] = {
+    "wrap",
+    "#ifdef __cplusplus\n\
+extern \"C\" {\n\
+#endif\n",
+    "#ifdef __cplusplus\n\
+}\n\
+#endif\n",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Aix_Externcpp1 fix
+ */
+tSCC zAix_Externcpp1Name[] =
+     "aix_externcpp1";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zAix_Externcpp1List[] =
+  "sys/socket.h\0";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzAix_Externcpp1Machs[] = {
+        "*-*-aix*",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zAix_Externcpp1Select0[] =
+       "#ifdef __cplusplus";
+
+#define    AIX_EXTERNCPP1_TEST_CT  1
+static tTestDesc aAix_Externcpp1Tests[] = {
+  { TT_EGREP,    zAix_Externcpp1Select0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Aix_Externcpp1
+ */
+static const char* apzAix_Externcpp1Patch[] = {
+    "format",
+    "#ifdef __cplusplus\n\
+extern \"C++\" {",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Aix_Externcpp2 fix
+ */
+tSCC zAix_Externcpp2Name[] =
+     "aix_externcpp2";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zAix_Externcpp2List[] =
+  "sys/socket.h\0";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzAix_Externcpp2Machs[] = {
+        "*-*-aix*",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zAix_Externcpp2Select0[] =
+       "#else  /\\* __cplusplus \\*/";
+
+#define    AIX_EXTERNCPP2_TEST_CT  1
+static tTestDesc aAix_Externcpp2Tests[] = {
+  { TT_EGREP,    zAix_Externcpp2Select0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Aix_Externcpp2
+ */
+static const char* apzAix_Externcpp2Patch[] = {
+    "format",
+    "} /* extern \"C++\" */\n\
+#else  /* __cplusplus */",
+    (char*)NULL };
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
  *  Description of Aix_Malloc fix
@@ -9278,9 +9396,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          263
+#define REGEX_COUNT          266
 #define MACH_LIST_SIZE_LIMIT 187
-#define FIX_COUNT            226
+#define FIX_COUNT            229
 
 /*
  *  Enumerate the fixes
@@ -9300,6 +9418,9 @@ typedef enum {
     AAB_VXWORKS_UNISTD_FIXIDX,
     AIX_ASSERT_FIXIDX,
     AIX_COMPLEX_FIXIDX,
+    AIX_EXTERNC_FIXIDX,
+    AIX_EXTERNCPP1_FIXIDX,
+    AIX_EXTERNCPP2_FIXIDX,
     AIX_MALLOC_FIXIDX,
     AIX_NET_IF_ARP_FIXIDX,
     AIX_NULL_FIXIDX,
@@ -9585,6 +9706,21 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      AIX_COMPLEX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aAix_ComplexTests,   apzAix_ComplexPatch, 0 },
 
+  {  zAix_ExterncName,    zAix_ExterncList,
+     apzAix_ExterncMachs,
+     AIX_EXTERNC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aAix_ExterncTests,   apzAix_ExterncPatch, 0 },
+
+  {  zAix_Externcpp1Name,    zAix_Externcpp1List,
+     apzAix_Externcpp1Machs,
+     AIX_EXTERNCPP1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aAix_Externcpp1Tests,   apzAix_Externcpp1Patch, 0 },
+
+  {  zAix_Externcpp2Name,    zAix_Externcpp2List,
+     apzAix_Externcpp2Machs,
+     AIX_EXTERNCPP2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aAix_Externcpp2Tests,   apzAix_Externcpp2Patch, 0 },
+
   {  zAix_MallocName,    zAix_MallocList,
      apzAix_MallocMachs,
      AIX_MALLOC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
index 314e283c533f41ee6b94dda968883870f19ee239..89c7aa8d93879ecaa92930587448df1423b34a02 100644 (file)
@@ -596,6 +596,56 @@ fix = {
     test_text = "#define _Complex_I    __I\n";
 };
 
+/*
+ *  On AIX some headers are not properly guarded by 'extern "C"'.
+ */
+fix = {
+  hackname  = aix_externc;
+  mach      = "*-*-aix*";
+  files     = ctype.h;
+  files     = fcntl.h;
+  files     = langinfo.h;
+  files     = ldfcn.h;
+  files     = sys/localedef.h;
+  files     = sys/times.h;
+  bypass    = "extern \"C\"";
+  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 int __n_pthreads;\n";
+};
+
+/*
+ *  On AIX sys/socket.h assumes C++.
+ */
+fix = {
+  hackname  = aix_externcpp1;
+  mach      = "*-*-aix*";
+  files     = "sys/socket.h";
+  select    = "#ifdef __cplusplus";
+  c_fix     = format;
+  c_fix_arg = "#ifdef __cplusplus\n"
+              "extern \"C++\" {";
+  test_text = "#ifdef __cplusplus";
+
+};
+
+fix = {
+  hackname  = aix_externcpp2;
+  mach      = "*-*-aix*";
+  files     = "sys/socket.h";
+  select    = "#else  /\\* __cplusplus \\*/";
+  c_fix     = format;
+  c_fix_arg = "} /* extern \"C++\" */\n"
+              "#else  /* __cplusplus */";
+  test_text = "#else  /* __cplusplus */";
+
+};
+
 /*
  *  malloc.h on AIX6 uses XLC++ specific builtin syntax
  */
index deabd5e447348026b6bd818733cdce03ab7d856a..834b2e52c3383be68b7590e8555c97f693caf4f0 100644 (file)
@@ -7,6 +7,18 @@
     This had to be done to correct non-standard usages in the
     original, manufacturer supplied header file.  */
 
+#ifndef FIXINC_WRAP_CTYPE_H_AIX_EXTERNC
+#define FIXINC_WRAP_CTYPE_H_AIX_EXTERNC 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if defined( AIX_EXTERNC_CHECK )
+extern int __n_pthreads;
+
+#endif  /* AIX_EXTERNC_CHECK */
 
 
 #if defined( HPUX10_CTYPE_DECLARATIONS1_CHECK )
@@ -63,3 +75,8 @@ extern int __toupper();
 # define isalpha(__c) (__SB_masks ? (int)__SB_masks[__c] & _IS
 
 #endif  /* HPUX_CTYPE_MACROS_CHECK */
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* FIXINC_WRAP_CTYPE_H_AIX_EXTERNC */
diff --git a/fixincludes/tests/base/fcntl.h b/fixincludes/tests/base/fcntl.h
new file mode 100644 (file)
index 0000000..3a40c01
--- /dev/null
@@ -0,0 +1,25 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+       "fixinc/tests/inc/fcntl.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+#ifndef FIXINC_WRAP_FCNTL_H_AIX_EXTERNC
+#define FIXINC_WRAP_FCNTL_H_AIX_EXTERNC 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if defined( AAB_AIX_FCNTL_CHECK )
+
+#endif  /* AAB_AIX_FCNTL_CHECK */
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* FIXINC_WRAP_FCNTL_H_AIX_EXTERNC */
index d0cd37e2574728a4bc2fbe5c75356cb59d9af0fb..5d66f8be2912beb3d830154d79a971ed1e952c9a 100644 (file)
@@ -9,6 +9,18 @@
 
 
 
+#if defined( AIX_EXTERNCPP1_CHECK )
+#ifdef __cplusplus
+extern "C++" {
+#endif  /* AIX_EXTERNCPP1_CHECK */
+
+
+#if defined( AIX_EXTERNCPP2_CHECK )
+} /* extern "C++" */
+#else  /* __cplusplus */
+#endif  /* AIX_EXTERNCPP2_CHECK */
+
+
 #if defined( HPUX11_EXTERN_SENDFILE_CHECK )
 #ifndef _APP32_64BIT_OFF_T
    extern sbsize_t sendfile __((int, int, off_t, bsize_t,