aboutsummaryrefslogtreecommitdiff
path: root/fixincludes/inclhack.def
diff options
context:
space:
mode:
authorDavid Edelsohn <dje.gcc@gmail.com>2015-05-21 17:25:00 +0000
committerDavid Edelsohn <dje@gcc.gnu.org>2015-05-21 13:25:00 -0400
commit9846edffa4b32333e313d5760e16efdb3dae5291 (patch)
tree7eb5b585f58c6ce347afff40652791a2c1f15c74 /fixincludes/inclhack.def
parente3592e196a92f72d6195023b24f4d1aab9c64242 (diff)
downloadgcc-9846edffa4b32333e313d5760e16efdb3dae5291.zip
gcc-9846edffa4b32333e313d5760e16efdb3dae5291.tar.gz
gcc-9846edffa4b32333e313d5760e16efdb3dae5291.tar.bz2
inclhack.def (aix_externc): New fix.
* 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. From-SVN: r223497
Diffstat (limited to 'fixincludes/inclhack.def')
-rw-r--r--fixincludes/inclhack.def50
1 files changed, 50 insertions, 0 deletions
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 314e283..89c7aa8 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -597,6 +597,56 @@ fix = {
};
/*
+ * 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
*/
fix = {