hackname = aix_externcpp1;
mach = "*-*-aix*";
files = "sys/socket.h";
- select = "#ifdef __cplusplus";
+ select = "#ifndef _KERNEL\n"
+ "#ifdef __cplusplus";
c_fix = format;
- c_fix_arg = "#ifdef __cplusplus\n"
+ c_fix_arg = "#ifndef _KERNEL\n"
+ "#ifdef __cplusplus\n"
"extern \"C++\" {";
- test_text = "#ifdef __cplusplus";
-
+ test_text = "#ifndef _KERNEL\n"
+ "#ifdef __cplusplus";
};
fix = {
hackname = aix_externcpp2;
mach = "*-*-aix*";
files = "sys/socket.h";
- select = "#else /\\* __cplusplus \\*/";
+ select = "#endif /\\* COMPAT_43 \\*/\n"
+ "#else /\\* __cplusplus \\*/";
c_fix = format;
- c_fix_arg = "} /* extern \"C++\" */\n"
+ c_fix_arg = "#endif /* COMPAT_43 */\n"
+ "} /* extern \"C++\" */\n"
"#else /* __cplusplus */";
- test_text = "#else /* __cplusplus */";
+ test_text = "#endif /* COMPAT_43 */\n"
+ "#else /* __cplusplus */";
+};
+/*
+ * inttypes.h STDC_FORMAT_MACROS
+ */
+fix = {
+ hackname = aix_inttypes;
+ mach = "*-*-aix*";
+ files = "sys/inttypes.h";
+ select = "#if !defined\\(__cplusplus\\) \\|\\| defined\\(__STDC_FORMAT_MACROS\\)";
+ c_fix = format;
+ c_fix_arg = "#if 1";
+ test_text = "#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)";
};
/*
hackname = aix_malloc;
mach = "*-*-aix*";
files = "malloc.h";
- select = "#ifdef __cplusplus";
+ select = "#ifdef __cplusplus\n"
+ "extern \"C\" \\{\n"
+ "[ \t]extern \"builtin\" char \\*__alloca \\(size_t\\);";
c_fix = format;
- c_fix_arg = "#if (defined(__cplusplus) && defined(__IBMCPP__))";
- test_text = "#ifdef __cplusplus";
+ c_fix_arg = "#if (defined(__cplusplus) && defined(__IBMCPP__))\n"
+ "extern \"C\" {\n"
+ "\textern \"builtin\" char *__alloca (size_t);";
+ test_text = "#ifdef __cplusplus\n"
+ "extern \"C\" {\n"
+ "\textern \"builtin\" char *__alloca (size_t);";
};
/*
"{ \\\\\n";
};
+
+/* On AIX 'typedef struct {<stuff>} * physadr_t;' needs to give the struct a
+ name for linkage purposes. Fortunately it is on exactly one
+ line. */
+fix = {
+ hackname = aix_physadr_t;
+ mach = "*-*-aix*";
+ files = sys/types.h;
+ select = "typedef[ \t]*struct[ \t]*([{][^}]*[}][ \t]*\\*[ \t]*physadr_t;)";
+ c_fix = format;
+ c_fix_arg = "typedef struct __physadr_s %1";
+ test_text = "typedef struct __physadr_s {";
+};
+
/*
* pthread.h on AIX 4.3.3 tries to define a macro without whitspace
* which violates a requirement of ISO C.