mach = "powerpcle-*-solaris2.[0-4]";
mach = "sparc-*-solaris2.[0-4]";
mach = "i[34567]86-sequent-ptx*";
- mach = "i[34567]86-sequent-sysv3*";
files = sys/byteorder.h;
replace = <<- _EndOfHeader_
#ifndef _SYS_BYTEORDER_H
/*
+ * Recognize GCC in Tru64 UNIX V5.1B <pthread.h>.
+ */
+fix = {
+ hackname = alpha_pthread_gcc;
+ files = pthread.h;
+ select = "#else\n# error <pthread.h>: unrecognized compiler.";
+
+ mach = "alpha*-dec-osf*";
+ c_fix = format;
+ c_fix_arg = "#elif defined (__GNUC__)\n"
+ "# define _PTHREAD_ENV_GCC\n"
+ "%0";
+
+ test_text = "# define _PTHREAD_ENV_INTELC\n"
+ "#else\n"
+ "# error <pthread.h>: unrecognized compiler.\n"
+ "#endif";
+};
+
+
+/*
* Fix return value of sbrk in unistd.h on Alpha OSF/1 V2.0
* And OpenBSD.
*/
/*
+ * Fix hpux 11.00 broken snprintf declaration
+ * (third argument is char *, needs to be const char * to prevent
+ * spurious warnings with -Wwrite-strings or in C++).
+ */
+fix = {
+ hackname = hpux11_snprintf;
+ files = stdio.h;
+ select = '(extern int snprintf *\(char *\*, *(|__|_hpux_)size_t,)'
+ ' *(char *\*, *\.\.\.\);)';
+ c_fix = format;
+ c_fix_arg = '%1 const %3';
+
+ test_text = "extern int snprintf(char *, size_t, char *, ...);\n"
+ "extern int snprintf(char *, __size_t, char *, ...);\n"
+ "extern int snprintf(char *, _hpux_size_t, char *, ...);";
+};
+
+
+/*
* In inttypes.h on HPUX 11, the use of __CONCAT__ in the definition
* of UINT32_C has undefined behavior according to ISO/ANSI:
* the arguments to __CONCAT__ are not macro expanded before the
files = stdio.h;
files = internal/stdio_core.h;
- select = '(printf\(.*), /\* va_list \*/ char \*';
+ select = '/\* va_list \*/ char \*';
c_fix = format;
- c_fix_arg = "%1, __gnuc_va_list";
+ c_fix_arg = "__gnuc_va_list";
test_text =
"extern int printf( const char *, /* va_list */ char * );";
};
/*
+ * Apparently some SVR4 systems typedef longlong_t to long ?
+ */
+#ifdef SVR4
+fix = {
+ hackname = longlong_t;
+ select = "typedef[ \t]+(unsigned[ \t]+)?long[ \t]+(u_)?longlong_t";
+ c_fix = format;
+ c_fix_arg = "typedef %1long long %2longlong_t";
+ test_text = "typedef long longlong_t\n"
+ "typedef unsigned long u_longlong_t";
+};
+#endif
+
+
+/*
* Delete the '#define void int' line from curses.h on Lynx
*/
fix = {
/*
+ * obstack.h used casts as lvalues.
+ *
+ * We need to change postincrements of casted pointers (which are
+ * then dereferenced and assigned into) of the form
+ *
+ * *((TYPE*)PTRVAR)++ = (VALUE)
+ *
+ * into expressions like
+ *
+ * ((*((TYPE*)PTRVAR) = (VALUE)), (PTRVAR += sizeof (TYPE)))
+ *
+ * which is correct for the cases used in obstack.h since PTRVAR is
+ * of type char * and the value of the expression is not used.
+ */
+fix = {
+ hackname = obstack_lvalue_cast;
+ files = obstack.h;
+ select = '\*\(\(([^()]*)\*\)(.*)\)\+\+ = \(([^()]*)\)';
+ c_fix = format;
+ c_fix_arg = "((*((%1*)%2) = (%3)), (%2 += sizeof (%1)))";
+ test_text = "*((void **) (h)->next_free)++ = (aptr)";
+};
+
+
+/*
* sys/lc_core.h on some versions of OSF1/4.x pollutes the namespace by
* defining regex.h related types. This causes libg++ build and usage
* failures. Fixing this correctly requires checking and modifying 3 files.
/*
+ * On DYNIX/ptx, sys/mc_param.h has an embedded asm for the cpuid instruction
+ * on the P5. This is not used by anything else so we ifdef it out.
+ * Current GCC doesn't seem to complain about the asm, though.
+ */
+#ifdef PTX
+fix = {
+ hackname = ptx_sys_mc_param_h;
+ files = sys/mc_param.h;
+ sed = "/__asm/,/}/{"
+ "/__asm/i\\\n"
+ "#if !defined (__GNUC__) && !defined (__GNUG__)\n"
+ "/}/a\\\n"
+ "#endif\n"
+ "}";
+ test_text = "__asm\n"
+ "int _CPUID()\n"
+ "{\n"
+ " non-GNU assembly here\n"
+ "}";
+};
+#endif
+
+
+/*
* Fix return type of fread and fwrite on sysV68
*/
fix = {
fix = {
hackname = solaris_widec;
files = widec.h;
- mach = '*-*-solaris2.[0-5]*';
+ mach = '*-*-solaris2.[0-5]';
+ mach = '*-*-solaris2.[0-5].*';
bypass = "include.*wchar\\.h";
select = "#include <euc.h>";
c_fix = format;
*/
sed = "s@ va_list @ __gnuc_va_list @\n"
"s@ va_list)@ __gnuc_va_list)@\n"
- "s@va_list _ap;@__gnuc_va_list _ap;@\n"
"s@(va_list)&@(__gnuc_va_list)\\&@\n"
"s@ _VA_LIST_));@ __gnuc_va_list));@\n"
"s@ __VA_LIST__));@ __gnuc_va_list));@\n"
* in any case. -- Nathanael */
mach = '*-*-sysv4*';
mach = 'i?86-sequent-ptx*';
- mach = 'i?86-sequent-sysv3*';
files = fs/rfs/rf_cache.h;
files = sys/erec.h;
files = sys/err.h;
/*
* Fix multiple defines for NULL. Sometimes, we stumble into \r\n
* terminated lines, so accommodate these. Test both ways.
+ * Don't bother to reproduce the \r\n termination, as GCC has to
+ * recognize \n termination anyway.
*/
fix = {
hackname = undefine_null;
bypass = "#[ \t]*(ifn|un)def[ \t]+NULL($|[ \t\r])";
c_fix = format;
- c_fix_arg = "#ifndef NULL%2\n#define NULL%1%2\n#endif%2\n";
- c_fix_arg = "^#[ \t]*define[ \t]*[ \t]NULL([^\r\n]+)([\r]*)\n";
+ c_fix_arg = "#ifndef NULL\n#define NULL%1\n#endif\n";
+ c_fix_arg = "^#[ \t]*define[ \t]+NULL([^\r\n]+)[\r]*\n";
- test_text = "#define NULL 0UL\r\n#define NULL\t((void*)0)\n";
+ test_text = "#define NULL 0UL\r\n"
+ "#define NULL\t((void*)0)\n";
};
/*