*/
fix = {
hackname = bsd_stdio_attrs_conflict;
- mach = *-*-*bsd*;
- mach = *-*-*darwin*;
+ mach = "*-*-*bsd*";
+ mach = "*-*-*darwin*";
files = stdio.h;
select = "^#define[ \t]*vfscanf[ \t]*__svfscanf[ \t]*$";
c_fix = format;
/*
+ * On darwin8 and earlier, mach-o/swap.h isn't properly guarded
+ * by 'extern "C"'. On darwin7 some mach/ headers aren't properly guarded.
+ */
+fix = {
+ hackname = darwin_externc;
+ mach = "*-*-darwin*";
+ files = mach-o/swap.h;
+ files = mach/mach_time.h;
+ files = mach/mach_traps.h;
+ files = mach/message.h;
+ files = mach/mig.h;
+ files = mach/semaphore.h;
+ bypass = "extern \"C\"";
+ bypass = "__BEGIN_DECLS";
+ 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 void swap_fat_header();\n";
+};
+
+
+/*
* AvailabilityMacros.h on Darwin breaks with GCC 4.0, because of
* bad __GNUC__ tests.
*/
*/
fix = {
hackname = freebsd_gcc3_breakage;
- mach = *-*-freebsd*;
+ mach = "*-*-freebsd*";
files = sys/cdefs.h;
select = '^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7$';
bypass = '__GNUC__[ \t]*([>=]=[ \t]*[3-9]|>[ \t]*2)';
*/
fix = {
hackname = freebsd_gcc4_breakage;
- mach = *-*-freebsd*;
+ mach = "*-*-freebsd*";
files = sys/cdefs.h;
select = '^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 \|\| __GNUC__ == 3$';
c_fix = format;
files = features.h, '*/features.h';
select = "^ *&& !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__$";
c_fix = format;
- c_fix_arg = "%0 && __STDC_VERSION__ < 199901L";
+ c_fix_arg = "%0 && (defined __extern_inline || defined __GNUC_GNU_INLINE__)";
test_text = <<-EOT
#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
&& !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
/*
+ * Similar, but a version that didn't have __NO_INLINE__
+ */
+fix = {
+ hackname = glibc_c99_inline_1a;
+ files = features.h, '*/features.h';
+ select = "(\\) && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__)\n"
+ "(#[ \t]*define[ \t]*__USE_EXTERN_INLINES[ \t]*1)";
+ c_fix = format;
+ c_fix_arg = "%1 && (defined __extern_inline || defined __GNUC_GNU_INLINE__)\n%2";
+ test_text = <<-EOT
+#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__
+# define __USE_EXTERN_INLINES 1
+#endif
+EOT;
+};
+
+
+/*
* The glibc_c99_inline_1 fix should have fixed everything. Unfortunately
* there are many glibc headers which do not respect __USE_EXTERN_INLINES.
* The remaining glibc_c99_inline_* fixes deal with some of those headers.
files = sys/stat.h, '*/sys/stat.h';
select = "extern __inline__ int";
sed = "s/extern int \\(stat\\|lstat\\|fstat\\|mknod\\)/"
- "#if __STDC_VERSION__ < 199901L\\\nextern\\\n#endif\\\n"
+ "#ifdef __GNUC_GNU_INLINE__\\\nextern\\\n#endif\\\n"
"__inline__ int \\1/";
sed = "s/extern int __REDIRECT\\(_NTH\\|\\) (\\(stat\\|lstat\\|fstat\\)/"
- "#if __STDC_VERSION__ < 199901L\\\nextern\\\n#endif\\\n"
+ "#ifdef __GNUC_GNU_INLINE__\\\nextern\\\n#endif\\\n"
"__inline__ int __REDIRECT\\1 (\\2/";
sed = "s/^extern __inline__ int/"
- "#if __STDC_VERSION__ < 199901L\\\nextern\\\n#endif\\\n"
+ "#ifdef __GNUC_GNU_INLINE__\\\nextern\\\n#endif\\\n"
"__inline__ int/";
test_text = <<-EOT
extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
fix = {
hackname = glibc_c99_inline_3;
files = bits/string2.h, '*/bits/string2.h';
- bypass = "__STDC_VERSION__";
+ select = "extern __inline";
+ bypass = "__extern_inline|__GNU_STDC_INLINE__";
c_fix = format;
- c_fix_arg = "# if defined(__cplusplus) || __STDC_VERSION__ >= 19901L";
+ c_fix_arg = "# if defined(__cplusplus) || defined(__GNUC_STDC_INLINE__)";
c_fix_arg = "^# ifdef __cplusplus$";
test_text = <<-EOT
# ifdef __cplusplus
fix = {
hackname = glibc_c99_inline_4;
- files = sys/sysmacros.h, '*/sys/sysmacros.h';
- bypass = "__STDC_VERSION__";
- select = ' extern ';
+ files = sys/sysmacros.h, '*/sys/sysmacros.h', wchar.h, '*/wchar.h';
+ bypass = "__extern_inline|__gnu_inline__";
+ select = "(^| )extern __inline";
c_fix = format;
- c_fix_arg = "\n#if __STDC_VERSION__ < 19901L\nextern\n#endif\n";
+ c_fix_arg = "%0 __attribute__ ((__gnu_inline__))";
test_text = <<-EOT
__extension__ extern __inline unsigned int
- __extension__ __extern_inline unsigned int
+ extern __inline unsigned int
EOT;
};
};
+fix = {
+ hackname = hppa_hpux_fp_macros;
+ mach = "hppa*-hp-hpux11*";
+ files = math.h;
+ select = "#[ \t]*define[ \t]*FP_NORMAL.*\n"
+ "#[ \t]*define[ \t]*FP_ZERO.*\n"
+ "#[ \t]*define[ \t]*FP_INFINITE.*\n"
+ "#[ \t]*define[ \t]*FP_SUBNORMAL.*\n"
+ "#[ \t]*define[ \t]*FP_NAN.*\n";
+ c_fix = format;
+ c_fix_arg = "#endif /* _INCLUDE_HPUX_SOURCE */\n\n#if defined(_INCLUDE_HPUX_SOURCE) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))\n%0#endif\n\n#ifdef _INCLUDE_HPUX_SOURCE\n";
+
+ test_text =
+ "# define FP_NORMAL 0\n"
+ "# define FP_ZERO 1\n"
+ "# define FP_INFINITE 2\n"
+ "# define FP_SUBNORMAL 3\n"
+ "# define FP_NAN 4\n";
+};
+
+
/*
* Fix hpux 10.X missing ctype declarations 1
*/
*/
fix = {
hackname = hpux11_abs;
- mach = ia64-hp-hpux11*;
+ mach = "ia64-hp-hpux11*";
files = stdlib.h;
select = "ifndef _MATH_INCLUDED";
c_fix = format;
};
/*
+ * Fix C99 constant in __POINTER_SET define.
+ */
+fix = {
+ hackname = hpux11_pthread_const;
+ mach = "*-hp-hpux11.[0-3]*";
+ files = sys/pthread.h;
+ select = "^#define[ \t]*__POINTER_SET[ \t]*\\(\\(void \\*\\) 1LL\\)";
+
+ c_fix = format;
+ c_fix_arg = "#define __POINTER_SET\t\t((void *) 1L)";
+ test_text = "#define __POINTER_SET\t\t((void *) 1LL)";
+};
+
+/*
* Add missing braces to pthread initializer defines.
*/
fix = {
};
/*
+ * IRIX 6.5 <stdint.h> only works with ISO C99 and errors out
+ * otherwise.
+ */
+fix = {
+ hackname = irix_stdint_c99;
+ files = stdint.h;
+ select = "(#ifndef __c99\n)(#error This header file is to be used only for c99 mode compilations)";
+
+ mach = "mips-sgi-irix6.5";
+ c_fix = format;
+ c_fix_arg = "#if 0\n"
+ "%2";
+ test_text =
+ "#ifndef __c99\n#error This header file is to be used only for c99 mode compilations\n#else";
+};
+
+
+/*
* IRIX 5.x's stdio.h and IRIX 6.5's internal/stdio_core.h declare
* some functions that take a va_list as
* taking char *. However, GCC uses void * for va_list, so
/*
+ * Some versions of NetBSD don't expect the C99 inline semantics.
+ */
+fix = {
+ hackname = netbsd_c99_inline_1;
+ mach = "*-*-netbsd*";
+ files = signal.h;
+ select = "extern __inline int";
+
+ c_fix = format;
+ c_fix_arg = "extern\n#ifdef __GNUC_STDC_INLINE__\n__attribute__((__gnu_inline__))\n#endif\n__inline int";
+
+ test_text = "extern __inline int\nsigaddset(sigset_t *set, int signo)\n{}";
+};
+
+
+fix = {
+ hackname = netbsd_c99_inline_2;
+ mach = "*-*-netbsd*";
+ files = signal.h;
+ select = "#define _SIGINLINE extern __inline";
+
+ c_fix = format;
+ c_fix_arg = <<- _EOArg_
+ #ifdef __GNUC_STDC_INLINE__
+ #define _SIGINLINE extern __attribute__((__gnu_inline__)) __inline
+ #else
+ %0
+ #endif
+ _EOArg_;
+
+ test_text = "#define _SIGINLINE extern __inline";
+};
+
+
+/*
* NetBSD has a semicolon after the ending '}' for some extern "C".
*/
fix = {
hackname = netbsd_extra_semicolon;
- mach = *-*-netbsd*;
+ mach = "*-*-netbsd*";
files = sys/cdefs.h;
select = "#define[ \t]*__END_DECLS[ \t]*};";
files = iso/math_c99.h;
c_fix = format;
c_fix_arg = "#define\tfpclassify(x) \\\n"
- " __extension__ ({ __typeof(x) __x_fp = (x); \\\n"
+ " __extension__ ({ const __typeof(x) __x_fp = (x); \\\n"
"\t\t isnan(__x_fp) \\\n"
"\t\t ? FP_NAN \\\n"
"\t\t : isinf(__x_fp) \\\n"
};
fix = {
- hackname = solaris_math_5;
- 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\tisfinite(x) \\\n"
- " __extension__ ({ __typeof (x) __x_f = (x); \\\n"
- "\t\t __builtin_expect(!isnan(__x_f - __x_f), 1); })";
- c_fix_arg = "^#define[ \t]+isfinite\\(x\\)[ \t]+__builtin_isfinite\\(x\\)";
- test_text =
- '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n"
- "#undef isfinite\n"
- "#define isfinite(x) __builtin_isfinite(x)";
-};
-
-fix = {
- hackname = solaris_math_6;
- 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\tisinf(x) \\\n"
- " __extension__ ({ __typeof (x) __x_i = (x); \\\n"
- "\t\t __builtin_expect(!isnan(__x_i) && !isfinite(__x_i), 0); })";
- c_fix_arg = "^#define[ \t]+isinf\\(x\\)[ \t]+__builtin_isinf\\(x\\)";
- test_text =
- '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n"
- "#undef isinf\n"
- "#define isinf(x) __builtin_isinf(x)";
-};
-
-fix = {
- hackname = solaris_math_7;
- 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\tisnormal(x) \\\n"
- " __extension__ ({ __typeof(x) __x_n = (x); \\\n"
- "\t\t if (__x_n < 0.0) __x_n = -__x_n; \\\n"
- "\t\t __builtin_expect(isfinite(__x_n) \\\n"
- "\t\t\t\t && (sizeof(__x_n) == sizeof(float) \\\n"
- "\t\t\t\t\t ? __x_n >= __FLT_MIN__ \\\n"
- "\t\t\t\t\t : sizeof(__x_n) == sizeof(long double) \\\n"
- "\t\t\t\t\t ? __x_n >= __LDBL_MIN__ \\\n"
- "\t\t\t\t\t : __x_n >= __DBL_MIN__), 1); })";
- c_fix_arg = "^#define[ \t]+isnormal\\(x\\)[ \t]+__builtin_isnormal\\(x\\)";
- test_text =
- '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n"
- "#undef isnormal\n"
- "#define isnormal(x) __builtin_isnormal(x)";
-};
-
-fix = {
hackname = solaris_math_8;
select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
bypass = "__GNUC__";