-
/* -*- Mode: C -*- */
autogen definitions fixincl;
/*
+ * Solaris <sys/varargs.h> is a DDK (aka kernel-land) header providing
+ * the same interface as <stdarg.h>. No idea why they couldn't have just
+ * used the standard header.
+ */
+fix = {
+ hackname = AAB_solaris_sys_varargs_h;
+ files = "sys/varargs.h";
+ mach = '*-*-solaris*';
+ replace = "#ifdef __STDC__\n"
+ "#include <stdarg.h>\n"
+ "#else\n"
+ "#include <varargs.h>\n"
+ "#endif\n";
+};
+
+
+/*
* Fix non-ANSI memcpy declaration that conflicts with gcc's builtin
* declaration on Sun OS 4.x. We must only fix this on Sun OS 4.x, because
* many other systems have similar text but correct versions of the file.
/*
+ * Make sure hpux defines abs in header.
+ */
+fix = {
+ hackname = hpux11_abs;
+ mach = ia64-hp-hpux11*;
+ files = stdlib.h;
+ select = "ifndef _MATH_INCLUDED";
+ c_fix = format;
+ c_fix_arg = "if !defined(_MATH_INCLUDED) || defined(__GNUG__)";
+// sed = "s/ifndef _MATH_INCLUDED/if !defined(_MATH_INCLUDED) || defined(__GNUG__)/";
+ test_text = "#ifndef _MATH_INCLUDED";
+};
+
+
+/*
* Prevent HP-UX 11 from defining __size_t and preventing size_t from
* being defined by having it define _hpux_size_t instead.
*/
select = '__cplusplus < 54321L';
sed = 's/defined(__cplusplus) && (__cplusplus < 54321L)/0/';
- test_text = '#if\tdefined(__cplusplus) && (__cplusplus < 54321L)';
+ test_text = "#if\tdefined(__cplusplus) && (__cplusplus < 54321L)";
};
+/*
+ * <widec.h> until Solaris 2.5.1 defines macros for a couple of <wchar.h>
+ * functions, breaking their prototypes if that file is included afterwards.
+ * Include <wchar.h> early to avoid this issue, as is done on Solaris 2.6
+ * and up.
+ */
+fix = {
+ hackname = solaris_widec;
+ files = widec.h;
+ mach = '*-*-solaris2.[0-5]*';
+ bypass = "include.*wchar\\.h";
+ select = "#include <euc.h>";
+ c_fix = format;
+ c_fix_arg = "%0\n#include <wchar.h>";
+ test_text = "#include <euc.h>";
+};
/*
* Sony NEWSOS 5.0 does not support the complete ANSI C standard.
"s@ __va_list)@ __gnuc_va_list)@\n"
"s@typedef[ \t]\\(.*\\)[ \t]va_list[ \t]*;"
"@typedef \\1 __not_va_list__;@\n"
+ "s@typedef[ \t]*__va_list__@typedef __gnuc_va_list@\n"
"s@GNUC_VA_LIST@GNUC_Va_LIST@\n"
"s@_NEED___VA_LIST@_NEED___Va_LIST@\n"
"s@VA_LIST@DUMMY_VA_LIST@\n"
/*
+ * __thread is now a keyword.
+ */
+fix = {
+ hackname = thread_keyword;
+ files = "pthread.h";
+ files = "bits/sigthread.h";
+ select = "([* ])__thread([,)])";
+ c_fix = format;
+ c_fix_arg = "%1__thr%2";
+
+ test_text =
+ "extern int pthread_create (pthread_t *__restrict __thread,\n"
+ "extern int pthread_kill (pthread_t __thread, int __signo);\n"
+ "extern int pthread_cancel (pthread_t __thread);";
+};
+
+/*
* if the #if says _cplusplus, not the double underscore __cplusplus
* that it should be
*/
};
+/*
+ * WindISS math.h headers include bogus extern declarations of
+ * numerous math functions that conflict with libstdc++-v3.
+ */
+fix = {
+ hackname = windiss_math1;
+ files = math.h;
+ mach = "*-*-windiss";
+ sed = "s|inline long double cosl.*|#ifndef __GNUC__|";
+
+ test_text = "inline long double cosl(long double);";
+};
+
+fix = {
+ hackname = windiss_math2;
+ files = math.h;
+ mach = "*-*-windiss";
+ sed = "s|/\\* long double declarations \\*/|"
+ "#endif /* __GNUC__ */|";
+
+ test_text = "/* long double declarations */";
+};
+
+/*
+ * WindISS headers include "diab/va_list.h" instead of "stdarg.h"
+ */
+fix = {
+ select = '(#include.*)diab/va_list.h';
+ hackname = windiss_valist;
+ sed = "s|diab/va_list.h|stdarg.h|";
+ mach = "*-*-windiss";
+
+ test_text = "#include <diab/va_list.h>";
+};
+
/*
* There are several name conflicts with C++ reserved words in X11 header
* files. These are fixed in some versions, so don't do the fixes if