# 2013-02-07 Stefan Teleman <[email protected]>
# Starting with S11.2, Solaris Standard C Library header files
# are compliant with C++2003 and C++2011. Therefore the fixinclude
# hacks provided below are no longer necessary.
--- gcc-4.7.3/fixincludes/inclhack.def 2012-03-26 07:59:00.000000000 -0700
+++ gcc-4.7.3/fixincludes/inclhack.def 2013-06-01 09:49:24.044863180 -0700
@@ -299,25 +299,6 @@
/*
- * 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 = <<- _EndOfHeader_
- #ifdef __STDC__
- #include <stdarg.h>
- #else
- #include <varargs.h>
- #endif
- _EndOfHeader_;
-};
-
-
-/*
* 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.
@@ -1683,35 +1664,6 @@
};
/*
- * Fix these files to use the types we think they should for
- * ptrdiff_t, size_t, and wchar_t.
- *
- * This defines the types in terms of macros predefined by our 'cpp'.
- * This is supposedly necessary for glibc's handling of these types.
- * It's probably not necessary for anyone else, but it doesn't hurt.
- */
-fix = {
- hackname = gnu_types;
- files = "sys/types.h";
- files = "stdlib.h";
- files = "sys/stdtypes.h";
- files = "stddef.h";
- files = "memory.h";
- files = "unistd.h";
- bypass = '_GCC_(PTRDIFF|SIZE|WCHAR)_T';
- select = "^[ \t]*typedef[ \t]+.*[ \t](ptrdiff|size|wchar)_t;";
- c_fix = gnu_type;
- /* The Solaris 10 headers already define these types correctly. */
- mach = '*-*-solaris2.1[0-9]*';
- not_machine = true;
-
- test_text = "typedef long int ptrdiff_t; /* long int */\n"
- "typedef uint_t size_t; /* uint_t */\n"
- "typedef ushort_t wchar_t; /* ushort_t */";
-};
-
-
-/*
* Fix HP & Sony's use of "../machine/xxx.h"
* to refer to: <machine/xxx.h>
*/
@@ -2840,39 +2792,6 @@
/*
- * Some math.h files define struct exception (it's in the System V
- * Interface Definition), which conflicts with the class exception defined
- * in the C++ file std/stdexcept.h. We redefine it to __math_exception.
- * This is not a great fix, but I haven't been able to think of anything
- * better.
- */
-fix = {
- hackname = math_exception;
- files = math.h;
- select = "struct exception";
- /*
- * This should be bypassed on __cplusplus, but some supposedly C++ C++
- * aware headers, such as Solaris 8 and 9, don't wrap their struct
- * exception either. So currently we bypass only for glibc, based on a
- * comment in the fixed glibc header. Ick.
- */
- bypass = 'We have a problem when using C\+\+|for C\+\+, '
- '_[a-z0-9A-Z_]+_exception; for C, exception';
- c_fix = wrap;
-
- c_fix_arg = "#ifdef __cplusplus\n"
- "#define exception __math_exception\n"
- "#endif\n";
-
- c_fix_arg = "#ifdef __cplusplus\n"
- "#undef exception\n"
- "#endif\n";
-
- test_text = "typedef struct exception t_math_exception;";
-};
-
-
-/*
* This looks pretty broken to me. ``dbl_max_def'' will contain
* "define DBL_MAX " at the start, when what we really want is just
* the value portion. Can't figure out how to write a test case
@@ -3337,727 +3256,6 @@
/*
- * Solaris 10+ <sys/feature_tests.h> defines _RESTRICT_KYWD as restrict
- * for C99. This is wrong for C++, which needs many C99 features, but
- * only supports __restrict.
- */
-fix = {
- hackname = solaris___restrict;
- files = sys/feature_tests.h;
- select = "#define[ \t]*_RESTRICT_KYWD[ \t]*restrict";
- mach = "*-*-solaris2*";
- c_fix = format;
- c_fix_arg = "#ifdef __cplusplus\n#define\t_RESTRICT_KYWD\t__restrict\n"
- "#else\n%0\n#endif";
- test_text = "#define _RESTRICT_KYWD restrict";
-};
-
-
-/*
- * Solaris 10+ complex.h defines _Complex_I and _Imaginary_I in terms of
- * themselves, which are Sun Studio compiler intrinsics. Remove _Imaginary_I
- * and imaginary definitions which are not supported by GCC.
- */
-fix = {
- hackname = solaris_complex;
- mach = "*-*-solaris2.*";
- files = complex.h;
- select = "#define[ \t]_Complex_I[ \t]_Complex_I";
- sed = "s/#define[ \t]_Complex_I[ \t]_Complex_I/"
- "#define\t_Complex_I\t(__extension__ 1.0iF)/";
- sed = "/#define[ \t]_Imaginary_I[ \t]_Imaginary_I/d";
- sed = "/#define[ \t]imaginary[ \t]_Imaginary/d";
- sed = "s/#define[ \t]I[ \t]\\{1,\\}_Imaginary_I/#define\tI\t\t_Complex_I/";
- test_text = "#define _Complex_I _Complex_I\n"
- "#define complex _Complex\n"
- "#define _Imaginary_I _Imaginary_I\n"
- "#define imaginary _Imaginary\n"
- "#undef I\n"
- "#define I _Imaginary_I";
-};
-
-
-/*
- * Solaris 10+ <complex.h> is wrapped in #ifndef __cplusplus. Wrap in
- * extern "C" instead so libstdc++ can use it.
- */
-fix = {
- hackname = solaris_complex_cxx;
- mach = "*-*-solaris2.*";
- files = complex.h;
- sed = "/#if[ \t]*!defined(__cplusplus)/c\\\n"
- "#ifdef\t__cplusplus\\\nextern \"C\" {\\\n#endif";
- sed = "/#endif[ \t]*\\/\\* !defined(__cplusplus) \\*\\//c\\\n"
- "#ifdef\t__cplusplus\\\n}\\\n#endif";
- test_text = "#if !defined(__cplusplus)\n"
- "#endif /* !defined(__cplusplus) */";
-};
-
-
-/*
- * Solaris 8 PTHREAD_COND_INITIALIZER lacks the __pthread_cond_magic field.
- * COND_MAGIC is only defined in <synch.h> and pollutes the namespace, so
- * use the value literally instead.
- */
-fix = {
- hackname = solaris_cond_init;
- select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
- files = pthread.h;
- mach = '*-*-solaris2.8';
- c_fix = format;
- c_fix_arg = "%1, 0x4356%2";
- c_fix_arg = "^(#define[ \t]+PTHREAD_COND_INITIALIZER[ \t]+"
- "\\{.*0)(\\},[ \t]*0\\}.*)$";
- test_text =
- '#pragma ident "@(#)pthread.h 1.29 01/07/07 SMI"'"\n"
- '#define PTHREAD_COND_INITIALIZER {{{0}, 0}, 0} /* = DEFAULTCV */';
-};
-
-
-/*
- * g++ rejects functions declared with both C and C++ linkage.
- */
-fix = {
- hackname = solaris_cxx_linkage;
- mach = '*-*-solaris2*';
- files = "iso/stdlib_iso.h";
- select = "(#if __cplusplus >= 199711L)\n"
- "(extern \"C\\+\\+\" \\{\n)"
- "(.*(bsearch|qsort).*)";
- c_fix = format;
- c_fix_arg = "%1 && !__GNUG__\n%2%3";
-
- test_text =
- "#if __cplusplus >= 199711L\n"
- "extern \"C++\" {\n"
- " void *bsearch(const void *, const void *, size_t, size_t,";
-};
-
-
-/*
- * Solaris <iso/stdio_iso.h> doesn't declare getc for C++ with
- * _STRICT_STDC, but uses it.
- */
-fix = {
- hackname = solaris_getc_strict_stdc;
- mach = "*-*-solaris2*";
- files = "iso/stdio_iso.h";
- select = "(.*&& )!defined\\(_STRICT_STDC\\)(.*)";
- c_fix = format;
- c_fix_arg = "%1(!defined(_STRICT_STDC) || (__cplusplus >= 199711L))%2";
-
- test_text =
- "#if !defined(_REENTRANT) && !defined(_LP64) && !defined(_STRICT_STDC)";
-};
-
-
-/*
- * Before Solaris 10, <iso/setjmp_iso.h> doesn't mark longjump noreturn.
- */
-fix = {
- hackname = solaris_longjmp_noreturn;
- mach = "*-*-solaris2*";
- files = "iso/setjmp_iso.h";
- bypass = "__NORETURN";
- select = "(.*longjmp\\(jmp_buf.*[^)]+\\));";
- c_fix = format;
- c_fix_arg = "%1 __attribute__ ((__noreturn__));";
-
- test_text = "extern void longjmp(jmp_buf, int);";
-};
-
-
-/*
- * Sun Solaris 10 defines several C99 math macros in terms of
- * builtins specific to the Studio compiler, in particular not
- * compatible with the GNU compiler.
- */
-fix = {
- hackname = solaris_math_1;
- select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
- bypass = "__GNUC__";
- files = iso/math_c99.h;
- c_fix = format;
- c_fix_arg = "#define\tHUGE_VA%1\t(__builtin_huge_va%2())";
- c_fix_arg = "^#define[ \t]+HUGE_VA([LF]+)[ \t]+__builtin_huge_va([lf]+)";
- test_text =
- '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n"
- "#undef HUGE_VAL\n"
- "#define HUGE_VAL __builtin_huge_val\n"
- "#undef HUGE_VALF\n"
- "#define HUGE_VALF __builtin_huge_valf\n"
- "#undef HUGE_VALL\n"
- "#define HUGE_VALL __builtin_huge_vall";
-};
-
-fix = {
- hackname = solaris_math_2;
- select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
- bypass = "__GNUC__";
- files = iso/math_c99.h;
- c_fix = format;
- c_fix_arg = "#define\tINFINITY\t(__builtin_inff())";
- c_fix_arg = "^#define[ \t]+INFINITY[ \t]+__builtin_infinity";
- test_text =
- '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n"
- "#undef INFINITY\n"
- "#define INFINITY __builtin_infinity";
-};
-
-fix = {
- hackname = solaris_math_3;
- select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
- bypass = "__GNUC__";
- files = iso/math_c99.h;
- c_fix = format;
- c_fix_arg = "#define\tNAN\t\t(__builtin_nanf(\"\"))";
- c_fix_arg = "^#define[ \t]+NAN[ \t]+__builtin_nan";
- test_text =
- '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n"
- "#undef NAN\n"
- "#define NAN __builtin_nan";
-};
-
-fix = {
- hackname = solaris_math_4;
- select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
- bypass = "__GNUC__";
- files = iso/math_c99.h;
- c_fix = format;
- c_fix_arg = "#define\tfpclassify(x) \\\n"
- " __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, (x))";
- c_fix_arg = "^#define[ \t]+fpclassify\\(x\\)[ \t]+__builtin_fpclassify\\(x\\)";
- test_text =
- '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n"
- "#undef fpclassify\n"
- "#define fpclassify(x) __builtin_fpclassify(x)";
-};
-
-fix = {
- hackname = solaris_math_8;
- select = '@\(#\)math_c99\.h' "[ \t]+1\\.[0-9]+[ \t]+[0-9/]+ SMI";
- bypass = "__GNUC__";
- files = iso/math_c99.h;
- c_fix = format;
- c_fix_arg = "#define\tsignbit(x)\t(sizeof(x) == sizeof(float) \\\n"
- "\t\t\t ? __builtin_signbitf(x) \\\n"
- "\t\t\t : sizeof(x) == sizeof(long double) \\\n"
- "\t\t\t ? __builtin_signbitl(x) \\\n"
- "\t\t\t : __builtin_signbit(x))";
- c_fix_arg = "^#define[ \t]+signbit\\(x\\)[ \t]+__builtin_signbit\\(x\\)";
- test_text = <<- _EOText_
- #ident "@(#)math_c99.h 1.9 04/11/01 SMI"
- #undef signbit
- #define signbit(x) __builtin_signbit(x)
- _EOText_;
-};
-
-fix = {
- hackname = solaris_math_9;
- select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
- bypass = "__GNUC__";
- files = iso/math_c99.h;
- c_fix = format;
- c_fix_arg = "#define\t%1(x, y)%2__builtin_%1(x, y)";
- c_fix_arg = "^#define[ \t]+([a-z]+)\\(x, y\\)([ \t]+)\\(\\(x\\) __builtin_[a-z]+\\(y\\)\\)";
- test_text =
- '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n"
- "#undef isgreater\n"
- "#define isgreater(x, y) ((x) __builtin_isgreater(y))\n"
- "#undef isgreaterequal\n"
- "#define isgreaterequal(x, y) ((x) __builtin_isgreaterequal(y))\n"
- "#undef isless\n"
- "#define isless(x, y) ((x) __builtin_isless(y))\n"
- "#undef islessequal\n"
- "#define islessequal(x, y) ((x) __builtin_islessequal(y))\n"
- "#undef islessgreater\n"
- "#define islessgreater(x, y) ((x) __builtin_islessgreater(y))\n"
- "#undef isunordered\n"
- "#define isunordered(x, y) ((x) __builtin_isunordered(y))";
-};
-
-/*
- * On Solaris 11, if you do isinf(NaN) you'll get a floating point
- * exception. Provide an alternative using GCC's builtin.
- */
-
-fix = {
- hackname = solaris_math_10;
- select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
- files = iso/math_c99.h;
- c_fix = format;
- c_fix_arg = "#define\tisinf(x) __builtin_isinf(x)";
- c_fix_arg = "^#define[ \t]+isinf\\(x\\)[ \t]+__extension__\\([ \t]*\\\\\n"
- "[ \t]*\\{[ \t]*__typeof\\(x\\)[ \t]*__x_i[ \t]*=[ \t]*\\(x\\);[ \t]*\\\\\n"
- "[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*INFINITY[ \t]*\\|\\|[ \t]*\\\\\n"
- "[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*\\(-INFINITY\\);[ \t]*\\}\\)";
- test_text =
- '#pragma ident "@(#)math_c99.h 1.12 07/01/21 SMI"'"\n"
- "#undef isinf\n"
- "#define isinf(x) __extension__( \\\\\n"
- " { __typeof(x) __x_i = (x); \\\\\n"
- " __x_i == (__typeof(__x_i)) INFINITY || \\\\\n"
- " __x_i == (__typeof(__x_i)) (-INFINITY); })";
-};
-
-/*
- * Sun Solaris defines PTHREAD_MUTEX_INITIALIZER with a trailing
- * "0" for the last field of the pthread_mutex_t structure, which is
- * of type upad64_t, which itself is typedef'd to int64_t, but with
- * __STDC__ defined (e.g. by -ansi) it is a union. So change the
- * initializer to "{0}" instead
- */
-fix = {
- hackname = solaris_mutex_init_2;
- select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
- files = pthread.h;
- /*
- * On Solaris 10, this fix is unnecessary because upad64_t is
- * always defined correctly regardless of the definition of the
- * __STDC__ macro. The first "mach" pattern matches up to
- * solaris9. The second "mach" pattern will not match any two (or
- * more) digit solaris version, but it will match e.g. 2.5.1.
- */
- mach = '*-*-solaris2.[0-9]', '*-*-solaris2.[0-9][!0-9]*';
- c_fix = format;
- c_fix_arg = "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n"
- "%0\n"
- "#else\n"
- "%1, {0}}%4\n"
- "#endif";
- c_fix_arg = "(^#define[ \t]+PTHREAD_(MUTEX|COND)_INITIALIZER[ \t]+"
- "(|/\*.*\*/[ \t]*\\\\\n[ \t]*)\\{.*)"
- ",[ \t]*0\\}" "(|[ \t].*)$";
- test_text =
- '#ident "@(#)pthread.h 1.26 98/04/12 SMI"'"\n"
- "#define PTHREAD_MUTEX_INITIALIZER\t{{{0},0}, {{{0}}}, 0}\n"
- "#define PTHREAD_COND_INITIALIZER\t{{{0}, 0}, 0}\t/* DEFAULTCV */\n"
- "#define PTHREAD_MUTEX_INITIALIZER /* = DEFAULTMUTEX */ \\\\\n"
- " {{0, 0, 0, DEFAULT_TYPE, _MUTEX_MAGIC}, {{{0}}}, 0}\n"
- "#define PTHREAD_COND_INITIALIZER /* = DEFAULTCV */ \\\\\n"
- " {{{0, 0, 0, 0}, DEFAULT_TYPE, _COND_MAGIC}, 0}";
-};
-
-
-/*
- * The pow overloads with int were removed in C++ 2011.
- */
-fix = {
- hackname = solaris_pow_int_overload;
- mach = '*-*-solaris2*';
- files = "iso/math_iso.h";
- select = "^[ \t]*inline [a-z ]* pow\\([^()]*, int [^()]*\\)"
- " *\\{[^{}]*\n[^{}]*\\}";
- c_fix = format;
- c_fix_arg = "#ifndef __GXX_EXPERIMENTAL_CXX0X__\n%0\n#endif";
-
- test_text =
- " inline long double pow(long double __X, int __Y) { return\n"
- " __powl(__X, (long double) (__Y)); }";
-};
-
-
-/*
- * Sun Solaris defines PTHREAD_RWLOCK_INITIALIZER with a "0" for some
- * fields of the pthread_rwlock_t structure, which are of type
- * upad64_t, which itself is typedef'd to int64_t, but with __STDC__
- * defined (e.g. by -ansi) it is a union. So change the initializer
- * to "{0}" instead.
- */
-fix = {
- hackname = solaris_rwlock_init_1;
- select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
- files = pthread.h;
- mach = '*-*-solaris*';
- c_fix = format;
- c_fix_arg = "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n"
- "%0\n"
- "#else\n"
- "%1{0, 0, 0, {{0}, {0}, {0}}, {{0}, {0}}, {{0}, {0}}}\n"
- "#endif";
- c_fix_arg = "(^#define[ \t]+PTHREAD_RWLOCK_INITIALIZER[ \t]+)"
- "\\{0, 0, 0, \\{0, 0, 0\\}, \\{0, 0\\}, \\{0, 0\\}\\}[ \t]*$";
-
- test_text =
- '#ident "@(#)pthread.h 1.26 98/04/12 SMI"'"\n"
- "#define PTHREAD_RWLOCK_INITIALIZER\t{0, 0, 0, {0, 0, 0}, {0, 0}, {0, 0}}";
-};
-
-
-/*
- * Sun Solaris defines PTHREAD_ONCE_INIT as an array containing a
- * structure. As such, it need two levels of brackets, but only
- * contains one. Wrap the macro definition in an extra layer.
- */
-fix = {
- hackname = solaris_once_init_1;
- select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
- files = pthread.h;
- mach = '*-*-solaris*';
- c_fix = format;
- c_fix_arg = "%1{%2}%3";
- c_fix_arg = "(^#define[ \t]+PTHREAD_ONCE_INIT[ \t]+\\{)([^}]+)(\\})[ \t]*$";
- test_text =
- '#pragma ident "@(#)pthread.h 1.37 04/09/28 SMI"'"\n"
- "#define PTHREAD_ONCE_INIT\t{0, 0, 0, PTHREAD_ONCE_NOTDONE}";
-};
-
-
-/*
- * Sun Solaris defines PTHREAD_ONCE_INIT with a "0" for some
- * fields of the pthread_once_t structure, which are of type
- * upad64_t, which itself is typedef'd to int64_t, but with __STDC__
- * defined (e.g. by -ansi) it is a union. So change the initializer
- * to "{0}" instead. This test relies on solaris_once_init_1.
- */
-fix = {
- hackname = solaris_once_init_2;
- select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
- files = pthread.h;
- /*
- * On Solaris 10, this fix is unnecessary because upad64_t is
- * always defined correctly regardless of the definition of the
- * __STDC__ macro. The first "mach" pattern matches up to
- * solaris9. The second "mach" pattern will not match any two (or
- * more) digit solaris version, but it will match e.g. 2.5.1.
- */
- mach = '*-*-solaris2.[0-9]', '*-*-solaris2.[0-9][!0-9]*';
- c_fix = format;
- c_fix_arg = "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n"
- "%0\n"
- "#else\n"
- "%1{0}, {0}, {0}, {%3}%4\n"
- "#endif";
- c_fix_arg = "(^#define[ \t]+PTHREAD_ONCE_INIT[ \t]+\\{\\{)"
- "(0, 0, 0, )(PTHREAD_[A-Z_]+)(\\}\\})[ \t]*$";
- test_text =
- '#ident "@(#)pthread.h 1.26 98/04/12 SMI"'"\n"
- "#define PTHREAD_ONCE_INIT\t{{0, 0, 0, PTHREAD_ONCE_NOTDONE}}\n";
-};
-
-
-/*
- * Sun Solaris 2 has a version of sys/int_const.h that defines
- * UINT8_C and UINT16_C to unsigned constants.
- */
-fix = {
- hackname = solaris_int_const;
- files = sys/int_const.h;
- mach = '*-*-solaris2*';
- c_fix = format;
- c_fix_arg = "#define\tUINT8_C(c)\t(c)\n"
- "%1\n"
- "#define\tUINT16_C(c)\t(c)";
- select = "^#define[ \t]+UINT8_C\\(c\\)[ \t]+__CONCAT__.*\n"
- "(/\*.*\*/)\n"
- "#define[ \t]+UINT16_C\\(c\\)[ \t]+__CONCAT__.*";
- test_text =
- "#define UINT8_C(c) __CONCAT__(c,u)\n"
- "/* CSTYLED */\n"
- "#define UINT16_C(c) __CONCAT__(c,u)";
-};
-
-
-/*
- * Sun Solaris 2 has a version of sys/int_limits.h that defines
- * UINT8_MAX and UINT16_MAX to unsigned constants.
- */
-fix = {
- hackname = solaris_int_limits_1;
- files = sys/int_limits.h;
- mach = '*-*-solaris2*';
- c_fix = format;
- c_fix_arg = "#define\tUINT8_MAX\t(255)\n"
- "#define\tUINT16_MAX\t(65535)";
- select = "^#define[ \t]+UINT8_MAX[ \t]+\\(255U\\)\n"
- "#define[ \t]+UINT16_MAX[ \t]+\\(65535U\\)";
- test_text =
- "#define UINT8_MAX (255U)\n"
- "#define UINT16_MAX (65535U)";
-};
-
-
-/*
- * Sun Solaris 2 has a version of sys/int_limits.h that defines
- * INT_FAST16 limits to wrong values for sys/int_types.h.
- */
-fix = {
- hackname = solaris_int_limits_2;
- files = sys/int_limits.h;
- mach = '*-*-solaris2*';
- c_fix = format;
- c_fix_arg = "#define\t%1_FAST16_%2 %132_%2";
- select = "^#define[ \t]+(INT|UINT)_FAST16_(MAX|MIN)[ \t](INT|UINT)16.*";
- test_text =
- "#define INT_FAST16_MAX INT16_MAX\n"
- "#define UINT_FAST16_MAX UINT16_MAX\n"
- "#define INT_FAST16_MIN INT16_MIN";
-};
-
-
-/*
- * Sun Solaris 2 has a version of sys/int_limits.h that defines
- * SIZE_MAX as unsigned long.
- */
-fix = {
- hackname = solaris_int_limits_3;
- files = sys/int_limits.h;
- mach = '*-*-solaris2*';
- c_fix = format;
- c_fix_arg = "#define\tSIZE_MAX\t4294967295U";
- select = "^#define[ \t]+SIZE_MAX[ \t]+4294967295UL";
- test_text =
- "#define SIZE_MAX 4294967295UL";
-};
-
-
-/*
- * Sun Solaris up to 9 has a version of sys/int_types.h that forbids use
- * of Standard C99 64-bit types in 32-bit mode.
- */
-fix = {
- hackname = solaris_int_types;
- select = "__STDC__ - 0 == 0";
- bypass = "_LONGLONG_TYPE";
- files = sys/int_types.h;
- c_fix = format;
- c_fix_arg =
- "(defined(_STDC_C99) || !defined(_STRICT_STDC) || defined(__GNUC__))";
- test_text =
- "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n"
- "typedef long long int64_t;\n"
- "#endif\n\n"
- "#if defined(_LP64) || (__STDC__ - 0 == 0 && !defined(_NO_LONGLONG))\n"
- "typedef int64_t intmax_t;\n"
- "#endif";
-};
-
-
-/*
- * Solaris 10+ <spawn.h> uses char *const argv[_RESTRICT_KYWD] in the
- * posix_spawn declarations, which doesn't work with C++.
- */
-fix = {
- hackname = solaris_posix_spawn_restrict;
- files = spawn.h;
- mach = '*-*-solaris2*';
- c_fix = format;
- c_fix_arg = "%1*_RESTRICT_KYWD %2%3";
- select = "(.*[ \t]+)([a-z]+)\\[_RESTRICT_KYWD\\](.*)";
- test_text =
- "char *const argv[_RESTRICT_KYWD],\n"
- "char *const envp[_RESTRICT_KYWD]);";
-};
-
-
-/*
- * Before Solaris 10, <stdio.h> lacks declarations of std::__filbuf and
- * std::__flsbuf, but <iso/stdio_iso.h> uses them.
- */
-fix = {
- hackname = solaris_std___filbuf;
- files = stdio.h;
- mach = '*-*-solaris2*';
- bypass = "using std::__filbuf";
- select = "(using std::perror;\n)(#endif)";
- c_fix = format;
- c_fix_arg = "%1#ifndef _LP64\n"
- "using std::__filbuf;\n"
- "using std::__flsbuf;\n"
- "#endif\n%2";
-
- test_text = "using std::perror;\n"
- "#endif";
-};
-
-
-/*
- * Sun Solaris 8 has what appears to be some gross workaround for
- * some old version of their c++ compiler. G++ doesn't want it
- * either, but doesn't want to be tied to SunPRO version numbers.
- */
-fix = {
- hackname = solaris_stdio_tag;
- files = stdio_tag.h;
-
- select = '__cplusplus < 54321L';
- /* In Solaris 10, the code in stdio_tag.h is conditionalized on
- "!defined(__GNUC__)" so we no longer need to fix it. */
- bypass = '__GNUC__';
- sed = 's/defined(__cplusplus) && (__cplusplus < 54321L)/0/';
-
- test_text = "#if\tdefined(__cplusplus) && (__cplusplus < 54321L)";
-};
-
-
-/*
- * On Solaris 8 and 9, __va_list needs to become a typedef for
- * __builtin_va_list to make -Wmissing-format-attribute work.
- */
-fix = {
- hackname = solaris_sys_va_list;
- files = sys/va_list.h;
- mach = '*-*-solaris2.[89]';
- select = "#if.*__STDC__.*\n"
- "typedef void \\*__va_list;\n"
- "#else\n"
- "typedef char \\*__va_list;\n"
- "#endif";
-
- c_fix = format;
- c_fix_arg = "#ifdef __GNUC__\n"
- "typedef __builtin_va_list __va_list;\n"
- "#else\n"
- "%0\n"
- "#endif";
- test_text = "#if defined(__STDC__) && !defined(__ia64)\n"
- "typedef void *__va_list;\n"
- "#else\n"
- "typedef char *__va_list;\n"
- "#endif";
-};
-
-
-/*
- * a missing semi-colon at the end of the statsswtch structure definition.
- */
-fix = {
- hackname = statsswtch;
- files = rpcsvc/rstat.h;
- select = "boottime$";
- c_fix = format;
- c_fix_arg = "boottime;";
- test_text = "struct statswtch {\n int boottime\n};";
-};
-
-
-/*
- * Arrange for stdio.h to use stdarg.h to define __gnuc_va_list.
- * On 4BSD-derived systems, stdio.h defers to machine/ansi.h; that's
- * OK too.
- */
-fix = {
- hackname = stdio_stdarg_h;
- files = stdio.h;
- bypass = "include.*(stdarg\.h|machine/ansi\.h)";
- /*
- * On Solaris 10, this fix is unncessary; <stdio.h> includes
- * <iso/stdio_iso.h>, which includes <sys/va_list.h>.
- */
- mach = '*-*-solaris2.1[0-9]*';
- not_machine = true;
-
- c_fix = wrap;
-
- c_fix_arg = "#define __need___va_list\n#include <stdarg.h>\n";
-
- test_text = "";
-};
-
-
-/*
- * Don't use or define the name va_list in stdio.h. This is for
- * ANSI. Note _BSD_VA_LIST_ is dealt with elsewhere. The presence
- * of __gnuc_va_list, __DJ_va_list, or _G_va_list is taken to
- * indicate that the header knows what it's doing -- under SUSv2,
- * stdio.h is required to define va_list, and we shouldn't break
- * that. On IRIX 6.5, internal/wchar_core.h used to get its
- * definition of va_list from stdio.h. Since this doesn't happen any
- * longer, use __gnuc_va_list there, too.
- */
-fix = {
- hackname = stdio_va_list;
- files = stdio.h;
- files = internal/stdio_core.h;
- files = internal/wchar_core.h;
- bypass = '__gnuc_va_list|_BSD_VA_LIST_|__DJ_va_list|_G_va_list';
- /*
- * On Solaris 10, the definition in
- * <stdio.h> is guarded appropriately by the _XPG4 feature macro;
- * there is therefore no need for this fix there.
- */
- mach = '*-*-solaris2.1[0-9]*';
- not_machine = true;
-
- /*
- * Use __gnuc_va_list in arg types in place of va_list.
- * On 386BSD use __gnuc_va_list instead of _VA_LIST_. On Tru64 UNIX V5.1A
- * use __gnuc_va_list instead of __VA_LIST__. We're hoping the
- * trailing parentheses and semicolon save all other systems from this.
- * Define __not_va_list__ (something harmless and unused)
- * instead of va_list.
- * Don't claim to have defined va_list.
- */
- sed = "s@[ \t]va_list\\([ \t)]\\)@ __gnuc_va_list\\1@\n"
- "s@(va_list)&@(__gnuc_va_list)\\&@\n"
- "s@ _VA_LIST_));@ __gnuc_va_list));@\n"
- "s@ __VA_LIST__));@ __gnuc_va_list));@\n"
- "s@ va_list@ __not_va_list__@\n"
- "s@\\*va_list@*__not_va_list__@\n"
- "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@_VA_LIST_DEFINED@_Va_LIST_DEFINED@\n"
- "s@_NEED___VA_LIST@_NEED___Va_LIST@\n"
- "s@VA_LIST@DUMMY_VA_LIST@\n"
- "s@_Va_LIST@_VA_LIST@";
- test_text = "extern void mumble( va_list);";
-};
-
-
-/*
- * Fix headers that use va_list from stdio.h to use the updated
- * va_list from the stdio_va_list change. Note _BSD_VA_LIST_ is
- * dealt with elsewhere. The presence of __gnuc_va_list,
- * __DJ_va_list, or _G_va_list is taken to indicate that the header
- * knows what it's doing.
- */
-fix = {
- hackname = stdio_va_list_clients;
- files = com_err.h;
- files = cps.h;
- files = curses.h;
- files = krb5.h;
- files = lc_core.h;
- files = pfmt.h;
- files = wchar.h;
- files = curses_colr/curses.h;
- bypass = '__gnuc_va_list|_BSD_VA_LIST_|__DJ_va_list|_G_va_list';
- /* Don't fix, if we use va_list from stdarg.h, or if the use is
- otherwise protected. */
- bypass = 'include <stdarg\.h>|#ifdef va_start';
-
- /*
- * Use __gnuc_va_list in arg types in place of va_list.
- * On 386BSD use __gnuc_va_list instead of _VA_LIST_. On Tru64 UNIX V5.1A
- * use __gnuc_va_list instead of __VA_LIST__. We're hoping the
- * trailing parentheses and semicolon save all other systems from this.
- * Define __not_va_list__ (something harmless and unused)
- * instead of va_list.
- * Don't claim to have defined va_list.
- */
- sed = "s@[ \t]va_list\\([ \t)]\\)@ __gnuc_va_list\\1@\n"
- "s@(va_list)&@(__gnuc_va_list)\\&@\n"
- "s@ _VA_LIST_));@ __gnuc_va_list));@\n"
- "s@ __VA_LIST__));@ __gnuc_va_list));@\n"
- "s@ va_list@ __not_va_list__@\n"
- "s@\\*va_list@*__not_va_list__@\n"
- "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@_VA_LIST_DEFINED@_Va_LIST_DEFINED@\n"
- "s@_NEED___VA_LIST@_NEED___Va_LIST@\n"
- "s@VA_LIST@DUMMY_VA_LIST@\n"
- "s@_Va_LIST@_VA_LIST@";
- test_text = "extern void mumble( va_list);";
-};
-
-
-/*
* "!__STDC__" or "__STDC__==0" or "__STDC__!=1" or "__STDC__-0==0"
* is "!defined( __STRICT_ANSI__ )"
*/
@@ -4371,36 +3569,6 @@
"#define SIG_IGN (void (*)())0\n";
};
-
-/*
- * Some SysV r4 systems, including Sequent's DYNIX/ptx, use the local
- * function 'getrnge' in <regexp.h> before they declare it. For these
- * systems add a 'static int' declaration of 'getrnge' into <regexp.h>
- * early on.
- *
- * 'getrnge' traditionally manipulates a file-scope global called 'size',
- * so put the declaration right after the declaration of 'size'.
- *
- * Don't do this if there is already a `static void getrnge' declaration
- * present, since this would cause a redeclaration error. Solaris 2.x has
- * such a declaration.
- */
-fix = {
- hackname = svr4_undeclared_getrnge;
- files = regexp.h;
- select = "getrnge";
- bypass = "static void getrnge";
- c_fix = format;
- c_fix_arg = "%0\n"
- "static int getrnge ();";
- c_fix_arg = "^static int[ \t]+size;";
- test_text = "static int size;\n"
- "/* stuff which calls getrnge() */\n"
- "static getrnge()\n"
- "{}";
-};
-
-
/*
* Fix return value of mem{ccpy,chr,cpy,set} and str{len,spn,cspn}
* in string.h on sysV68