/*
+ * Tru64 UNIX V4.0F/V5.1 <standards.h> defines _NO_PROTO and _NONSTD_TYPES
+ * correctly for GCC, but strict_ansi_not breaks it.
+ */
+fix = {
+ hackname = AAA_standards;
+ files = standards.h;
+ select = 'GNU and MIPS C compilers define __STDC__ differently';
+ replace; /* empty replacement -> no fixing the file */
+};
+
+
+/*
* This file on SunOS 4 has a very large macro. When the sed loop
* tries pull it in, it overflows the pattern space size of the SunOS
* sed (GNU sed does not have this problem). Since the file does not
/* And now, the real fixes, replacement text fixes first: */
/*
- * Completely replace <_int_varargs.h> with a file that includes gcc's
+ * Completely replace <_int_varargs.h> with a file that includes gcc's
* stdarg.h or varargs.h files as appropriate on DG/UX
*/
fix = {
hackname = AAB_dgux_int_varargs;
files = _int_varargs.h;
- replace = "#ifndef __INT_VARARGS_H
+ replace =
+"#ifndef __INT_VARARGS_H
\#define __INT_VARARGS_H
/************************************************************************/
*/
\#ifndef ___int_features_h
-\#include <sys/_int_features.h>
+\#include <sys/_int_features.h>
\#endif
\#if !(defined(_VA_LIST) || defined(_VA_LIST_))
fix = {
hackname = AAB_fd_zero_asm_posix_types_h;
files = asm/posix_types.h;
- mach = 'i[34567]86-*-linux-gnu*';
+ mach = 'i[34567]86-*-linux*';
bypass = '} while';
/*
fix = {
hackname = AAB_fd_zero_gnu_types_h;
files = gnu/types.h;
- mach = 'i[34567]86-*-linux-gnu*';
+ mach = 'i[34567]86-*-linux*';
/*
* Define _TYPES_H_WRAPPER at the end of the wrapper, not
fix = {
hackname = AAB_fd_zero_selectbits_h;
files = selectbits.h;
- mach = 'i[34567]86-*-linux-gnu*';
+ mach = 'i[34567]86-*-linux*';
/*
* Define _SELECTBITS_H_WRAPPER at the end of the wrapper, not
files = limits.h;
mach = "*-*-ultrix4.3";
replace =
-'/* @(#)limits.h */
-/* This file was generated by fixincludes */
-\#ifndef _LIMITS_INCLUDED
+'#ifndef _LIMITS_INCLUDED
\#define _LIMITS_INCLUDED
\#include <sys/limits.h>
\#endif /* _LIMITS_INCLUDED */
files = memory.h;
mach = "*-*-ultrix4.3";
replace =
-'/* @(#)memory.h */
-/* This file was generated by fixincludes */
-\#ifndef _MEMORY_INCLUDED
+'#ifndef _MEMORY_INCLUDED
\#define _MEMORY_INCLUDED
\#include <strings.h>
\#endif /* _MEMORY_INCLUDED */
files = string.h;
mach = "*-*-ultrix4.3";
replace =
-'/* @(#)string.h */
-/* This file was generated by fixincludes */
-\#ifndef _STRING_INCLUDED
+'#ifndef _STRING_INCLUDED
\#define _STRING_INCLUDED
\#include <strings.h>
\#endif /* _STRING_INCLUDED */
/*
+ * pthread.h on AIX 4.3.3 tries to define a macro without whitspace
+ * which violates a requirement of ISO C.
+ */
+fix = {
+ hackname = aix_pthread;
+ files = "pthread.h";
+ select = "(#define [A-Za-z_0-9]+)(\\\\\n[^A-Za-z_0-9 \t\n(])";
+ c_fix = format;
+ c_fix_arg = "%1 %2";
+ test_text = "#define PTHREAD_MUTEX_INITIALIZER\\\\\n"
+ "{...init stuff...}";
+};
+
+
+/*
+ * sys/machine.h on AIX 4.3.3 puts whitespace between a \ and a newline
+ * in an otherwise harmless (and #ifed out) macro definition
+ */
+fix = {
+ hackname = aix_sysmachine;
+ files = sys/machine.h;
+ select = "\\\\ +\n";
+ c_fix = format;
+ c_fix_arg = "\\\n";
+ test_text = "#define FOO \\\n"
+ " bar \\ \n baz \\ \n bat";
+};
+
+
+/*
* sys/wait.h on AIX 3.2.5 puts the declaration of wait3 before the
* definition of struct rusage, so the prototype added by fixproto fails.
*/
/*
+ * Fix __assert declaration in assert.h on Alpha OSF/1.
+ */
+fix = {
+ hackname = alpha___assert;
+ files = "assert.h";
+ select = '__assert\(char \*, char \*, int\)';
+ c_fix = format;
+ c_fix_arg = "__assert(const char *, const char *, int)";
+ test_text = 'extern void __assert(char *, char *, int);';
+};
+
+
+/*
* Fix getopt declarations in stdio.h and stdlib.h on Alpha OSF/1 and AIX.
*/
fix = {
};
-/*
+/*
* Remove erroneous parentheses in sym.h on Alpha OSF/1.
*/
fix = {
c_fix = format;
c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
- c_fix_arg = "^[ \t]*typedef[ \t].*[ \t]bool[ \t]*;.*";
- test_text = "typedef unsigned int\tbool \t; /* bool type */";
+ test_text = "typedef unsigned int\tbool \t; /* bool\n type */";
};
+/*
+ * For C++, avoid any typedef definition of wchar_t,
+ * and use the built in type instead.
+ */
+
+fix = {
+ hackname = avoid_wchar_t_type;
+
+ select = "^[ \t]*typedef[ \t].*[ \t]wchar_t[ \t]*;";
+
+ c_fix = format;
+ c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
+
+ test_text = "typedef unsigned short\twchar_t \t; /* wchar_t\n type */";
+};
/*
* Fix #defines under Alpha OSF/1:
/*
* Remove `extern double cabs' declarations from math.h.
- * This conflicts with C9x. Discovered on AIX.
+ * This conflicts with C99. Discovered on AIX.
* SunOS4 has its cabs() declaration followed by a comment which
* terminates on the following line.
*/
fix = {
hackname = broken_cabs;
files = "math.h";
- select = '^extern double cabs';
+ select = '^extern[ \t]+double[ \t]+cabs';
c_fix = format;
c_fix_arg = "";
- c_fix_arg = "^extern double cabs\\((struct dbl_hypot|)\\);";
+ c_fix_arg = "^extern[ \t]+double[ \t]+cabs\\((struct dbl_hypot|)\\);";
test_text = "#ifdef __STDC__\n"
- "extern double cabs(struct dbl_hypot);\n"
+ "extern double cabs(struct dbl_hypot);\n"
"#else\n"
- "extern double cabs();\n"
+ "extern double cabs();\n"
"#endif\n"
"extern double cabs(); /* This is a comment\n"
" and it ends here. */";
/*
+ * Fix typo in <wchar.h> on DJGPP 2.03.
+ */
+fix = {
+ hackname = djgpp_wchar_h;
+ file = wchar.h;
+ select = "__DJ_wint_t";
+ bypass = "sys/djtypes.h";
+ c_fix = format;
+ c_fix_arg = "%0\n#include <sys/djtypes.h>";
+ c_fix_arg = "#include <stddef.h>";
+ test_text = "#include <stddef.h>\n"
+ "extern __DJ_wint_t x;\n";
+};
+
+/*
* Fix these Sun OS files to avoid an invalid identifier in an #ifdef.
*/
fix = {
/*
- * Fix HP's use of ../machine/inline.h to refer to
- * /usr/include/machine/inline.h
+ * Between 8/24/1998 and 2/17/2001, FreeBSD system headers presume
+ * neither the existence of GCC 3 nor its exact feature set yet break
+ * (by design?) when __GNUC__ is set beyond 2.
+ */
+fix = {
+ hackname = freebsd_gcc3_breakage;
+ mach = *-*-freebsd*;
+ files = sys/cdefs.h;
+ select = '^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7$';
+ bypass = '__GNUC__[ \t]*([>=]=[ \t]*[3-9]|>[ \t]*2)';
+ c_fix = format;
+ c_fix_arg = '%0 || __GNUC__ >= 3';
+ test_text = '#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7';
+};
+
+
+/*
+ * Fix HP & Sony's use of "../machine/xxx.h"
+ * to refer to: <machine/xxx.h>
*/
fix = {
hackname = hp_inline;
fix = {
hackname = hpux_maxint;
files = sys/param.h;
- select = "^#[ \t]*define[ \t]*MAXINT[ \t]";
+ files = values.h;
+ select = "^#[ \t]*define[ \t]+MAXINT[ \t]";
+ bypass = "^#[ \t]*ifndef[ \t]+MAXINT";
+ test =
+ "-n \"`egrep '#[ \t]*define[ \t]+MAXINT[ \t]' sys/param.h`\"";
c_fix = format;
c_fix_arg = "#ifndef MAXINT\n%0\n#endif";
- c_fix_arg = "^#[ \t]*define[ \t]*MAXINT[ \t].*";
+ c_fix_arg = "^#[ \t]*define[ \t]+MAXINT[ \t].*";
test_text = '#define MAXINT 0x7FFFFFFF';
};
/*
- * Some IRIX header files contain the string "//"
- */
+ * IRIX 5.x's stdio.h declares some functions that take a va_list as
+ * taking char *. However, GCC uses void * for va_list, so
+ * calling vfprintf with a va_list fails in C++. */
fix = {
- hackname = irix_multiline_cmnt;
- files = sys/types.h;
+ hackname = irix_stdio_va_list;
+ files = stdio.h;
- sed = "s@type of the result@type of the result */@";
- sed = "s@of the sizeof@/* of the sizeof@";
+ select = '(printf\(.*), /\* va_list \*/ char \*';
+ c_fix = format;
+ c_fix_arg = "%1, __gnuc_va_list";
test_text =
- "/* we check the type of the result\n"
- "// of the sizeof something. This is a bad test :-( */";
+ "extern int printf( const char *, /* va_list */ char * );";
+};
+
+
+/*
+ * Non-traditional "const" declaration in Irix's limits.h.
+ */
+fix = {
+ hackname = irix_limits_const;
+ files = fixinc-test-limits.h, limits.h;
+ select = "^extern const ";
+ c_fix = format;
+ c_fix_arg = "extern __const ";
+ test_text = "extern const char limit; /* test limits */";
};
/*
+ * GNU libc1 string.h does not prototype memcpy and memcmp for gcc
+ * versions > 1. This fix will open up the declaration for all
+ * versions of GCC and for g++.
+ */
+fix = {
+ hackname = libc1_ifdefd_memx;
+
+ /* The string.h result is overwritten by AAB_ultrix_string when doing
+ "make check" and will fail. Therefore, we add the following kludgery
+ to insert the test_text into the special testing header. :-} */
+ files = testing.h;
+ files = string.h;
+
+ c_fix = format;
+ select = "' is a built-in function for gcc 2\\.x\\. \\*/";
+ bypass = __cplusplus;
+ c_fix_arg = "%1";
+ c_fix_arg =
+ '/\* `mem...\' is a built-in function for gcc 2\.x\. \*/' "\n"
+ '#if defined\(__STDC__\) && __GNUC__ < 2' "\n"
+ "(/\\* .* \\*/\n"
+ "extern [a-z_]+ mem.*(\n[^#].*)*;)\n"
+ "#endif";
+
+ test_text =
+ "/* \\`memcpy' is a built-in function for gcc 2.x. */\n"
+ "#if defined(__STDC__) && __GNUC__ < 2\n"
+ "/* Copy N bytes of SRC to DEST. */\n"
+ "extern __ptr_t memcpy __P ((__ptr_t __dest, __const __ptr_t __src,\n"
+ " size_t __n));\n"
+ "#endif";
+};
+
+
+/*
* In limits.h, put #ifndefs around things that are supposed to be defined
* in float.h to avoid redefinition errors if float.h is included first.
* On HP/UX this patch does not work, because on HP/UX limits.h uses
*/
fix = {
hackname = limits_ifndefs;
- files = "limits.h";
files = "sys/limits.h";
+ files = "limits.h";
bypass = "ifndef[ \t]+FLT_MIN";
c_fix = format;
/*
* Fix BSD machine/ansi.h to use __builtin_va_list to define _BSD_VA_LIST_.
+ *
+ * On NetBSD, machine is a symbolic link to an architecture specific
+ * directory name, so we can't match a specific file name here.
*/
fix = {
hackname = machine_ansi_h_va_list;
- files = machine/ansi.h;
select = "define[ \t]+_BSD_VA_LIST_[ \t]";
bypass = '__builtin_va_list';
fix = {
hackname = math_huge_val_from_dbl_max;
files = math.h;
+
/*
* IF HUGE_VAL is defined to be DBL_MAX *and* DBL_MAX is _not_ defined
* in math.h, this fix applies.
*/
- select = "define[ \t]*HUGE_VAL[ \t]*DBL_MAX";
- bypass = "define[ \t]*DBL_MAX";
+ select = "define[ \t]+HUGE_VAL[ \t]+DBL_MAX";
+ bypass = "define[ \t]+DBL_MAX";
shell =
/*
*/
"\tdbl_max_def=`egrep 'define[ \t]+DBL_MAX[ \t]+.*' float.h "
- "2>/dev/null`\n\n"
+ "| sed 's/.*DBL_MAX[ \t]*//' 2>/dev/null`\n\n"
"\tif ( test -n \"${dbl_max_def}\" ) > /dev/null 2>&1\n"
"\tthen sed -e '/define[ \t]*HUGE_VAL[ \t]*DBL_MAX/"
- "s/DBL_MAX/'\"$dbl_max_def/\"\n"
+ "s@DBL_MAX@'\"$dbl_max_def@\"\n"
"\telse cat\n"
"\tfi";
+
+ test_text =
+ "`echo '#define DBL_MAX\t3.1415e+9 /* really big */' >> float.h`\n"
+ "#define HUGE_VAL DBL_MAX";
};
fix = {
hackname = nested_motorola;
mach = "m68k-motorola-sysv*";
- files = limits.h;
files = sys/limits.h;
+ files = limits.h;
+ select = "max # bytes atomic in write|error value returned by Math lib";
+
sed = "s@^\\(#undef[ \t][ \t]*PIPE_BUF[ \t]*"
"/\\* max # bytes atomic in write to a\\)$@\\1 */@";
sed = "s@\\(/\\*#define\tHUGE_VAL\t3.[0-9e+]* \\)"
"\\(/\\*error value returned by Math lib\\*/\\)$@\\1*/ \\2@";
+
+ test_text =
+ "#undef PIPE_BUF /* max # bytes atomic in write to a\n"
+ "\t\t/* PIPE */\n"
+ "/*#define\tHUGE_VAL\t3.9e+9 /*error value returned by Math lib*/";
};
/*
- * "!__STDC__" is "!defined( __STRICT_ANSI__ )"
+ * "!__STDC__" or "__STDC__==0" or "__STDC__!=1" or "__STDC__-0==0"
+ * is "!defined( __STRICT_ANSI__ )"
*/
fix = {
- hackname = sco_strict_ansi;
- mach = "i?86-*-sco3.2*";
- select = "^[ \t]*#[ \t]*if.*!__STDC__";
+ hackname = strict_ansi_not;
+ select = "^([ \t]*#[ \t]*if.*)"
+ "(!__STDC__"
+ "|__STDC__[ \t]*==[ \t]*0"
+ "|__STDC__[ \t]*!=[ \t]*1"
+ "|__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0"
+ ")(.*)";
+ c_test = stdc_0_in_system_headers;
c_fix = format;
- c_fix_arg = "%1defined(__STRICT_ANSI__)%2";
- c_fix_arg = "^([ \t]*#[ \t]*if[ \t].*!)__STDC__(.*)";
+ c_fix_arg = "%1 !defined(__STRICT_ANSI__)%3";
- test_text = "#if !__STDC__ /* not standard C */\nint foo;\n#endif";
+ test_text = "#if !__STDC__ \n"
+ "#if __STDC__ == 0\n"
+ "#if __STDC__ != 1\n"
+ "#if __STDC__ - 0 == 0"
+ "/* not std C */\nint foo;\n"
+ "\n#end-end-end-end-if :-)";
+};
+
+/*
+ * "__STDC__-0==0"
+ * is "!defined( __STRICT_ANSI__ )" on continued #if-s
+ */
+fix = {
+ hackname = strict_ansi_not_ctd;
+ files = math.h, limits.h, stdio.h, signal.h, stdlib.h, time.h;
+ select = "^([ \t]*[|&][|&][ \t(]*)"
+ "(__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0"
+ ")(.*)";
+ c_test = stdc_0_in_system_headers;
+
+ c_fix = format;
+ c_fix_arg = "%1 !defined(__STRICT_ANSI__)%3";
+
+ test_text = "#if 1\\\n"
+ "|| __STDC__ - 0 == 0 /* not std C */\nint foo;\n#endif";
+};
+
+/*
+ * "__STDC__!=0" or "__STDC__==1" or "__STDC__-0==1"
+ * is "defined( __STRICT_ANSI__ )"
+ */
+fix = {
+ hackname = strict_ansi_only;
+ select = "^([ \t]*#[ \t]*if.*)"
+ "(__STDC__[ \t]*!=[ \t]*0"
+ "|__STDC__[ \t]*==[ \t]*1"
+ "|__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*1"
+ "|__STDC__[ \t]*-[ \t]*0[ \t]*!=[ \t]*0"
+ ")(.*)";
+ c_test = stdc_0_in_system_headers;
+
+ c_fix = format;
+ c_fix_arg = "%1 defined(__STRICT_ANSI__)%3";
+
+ test_text = "#if __STDC__ == 1 /* is std C\n */\nint foo;\n#endif";
};
/*
+ * Sun Solaris 2.7 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 = solaris27_mutex_init;
+ select = '@\(#\)pthread.h' "[ \t]+1.26[ \t]+98/04/12 SMI";
+ files = pthread.h;
+ c_fix = format;
+ c_fix_arg = "%1, {0}}";
+ c_fix_arg = "(define[ \t]+PTHREAD_MUTEX_INITIALIZER.*),[ \t]*0}$";
+ test_text =
+ '#ident "@(#)pthread.h 1.26 98/04/12 SMI"'"\n"
+ "#define PTHREAD_MUTEX_INITIALIZER {{{0},0}, {{{0}}}, 0}";
+};
+
+
+/*
* Sony NEWSOS 5.0 does not support the complete ANSI C standard.
*/
#ifdef SONY
/*
- * Incorrect #include in Sony News-OS 3.2.
- */
-fix = {
- hackname = sony_include;
- files = machine/machparam.h;
- select = '"\.\./machine/endian.h"';
- sed = 's@"../machine/endian.h"@<machine/endian.h>@';
-};
-
-
-/*
* Sony NEWSOS 5.0 does not support the complete ANSI C standard.
*/
#ifdef SONY
fix = {
hackname = stdio_va_list;
files = stdio.h;
- bypass = '__gnuc_va_list|_BSD_VA_LIST_';
+ bypass = '__gnuc_va_list|_BSD_VA_LIST_|__DJ_va_list';
/*
* Use __gnuc_va_list in arg types in place of va_list.
"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);";
};
/*
- * Check for strict ansi compliance
- */
-#ifdef STRICT_ANSI
-fix = {
- hackname = strict_ansi;
- select = "__STDC__[ \t]*[=!]=[ \t]*[01]";
- sed = "s/__STDC__[ \t]*==[ \t]*0/!defined (__STRICT_ANSI__)/g";
- sed = "s/__STDC__[ \t]*!=[ \t]*0/defined (__STRICT_ANSI__)/g";
- sed = "s/__STDC__[ \t]*==[ \t]*1/defined (__STRICT_ANSI__)/g";
- sed = "s/__STDC__[ \t]*!=[ \t]*1/!defined (__STRICT_ANSI__)/g";
-};
-#endif
-
-
-/*
* IRIX 4.0.5 <rpc/xdr.h> uses struct __file_s
* in prototype without previous definition.
*/
files = math.h;
/* If matherr has a prototype already, the header needs no fix. */
- bypass = 'matherr.*struct exception';
+ bypass = 'matherr.*(struct exception|__MATH_EXCEPTION)';
select = matherr;
c_fix = wrap;
* Conditionalize some of <sys/endian.h> on __GNUC__ and __GNUG__.
* On some systems (UnixWare 2, UnixWare 7), the file is byteorder.h
* but we still "hijack" it and redirect it to the GNU byteorder.h..
- *
- *
*/
#ifdef SVR5
fix = {
/*
* Fix these files to use the same types that we think they should.
- * XXX - extremely dubious changes here.
*/
fix = {
- hackname = systypes;
+ hackname = gnu_types;
files = "sys/types.h";
files = "stdlib.h";
files = "sys/stdtypes.h";
files = "stddef.h";
files = "memory.h";
files = "unistd.h";
- select = "typedef[ \t]+[a-z_][ \ta-z_]*[ \t]"
- "(size|ptrdiff|wchar)_t";
-
- sed = "/^[ \t]*\\*[ \t]*typedef unsigned int size_t;/N";
+ bypass = '_GCC_(PTRDIFF|SIZE|WCHAR)_T';
+ select = "^[ \t]*typedef[ \t]+.*[ \t](ptrdiff|size|wchar)_t;";
+ c_fix = gnu_type;
- sed = "s/^\\([ \t]*\\*[ \t]*typedef unsigned int size_t;\\n"
- "[ \t]*\\*\\/\\)/\\1\\\n"
- "#ifndef __SIZE_TYPE__\\\n"
- "#define __SIZE_TYPE__ long unsigned int\\\n"
- "#endif\\\n"
- "typedef __SIZE_TYPE__ size_t;\\\n/";
-
- sed = "/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]size_t/i\\\n"
- "#ifndef __SIZE_TYPE__\\\n"
- "#define __SIZE_TYPE__ long unsigned int\\\n"
- "#endif\n";
-
- sed = "s/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]size_t/"
- "typedef __SIZE_TYPE__ size_t/";
-
- sed = "/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]ptrdiff_t/i\\\n"
- "#ifndef __PTRDIFF_TYPE__\\\n"
- "#define __PTRDIFF_TYPE__ long int\\\n"
- "#endif\n";
-
- sed = "s/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]ptrdiff_t/"
- "typedef __PTRDIFF_TYPE__ ptrdiff_t/";
-
- sed = "/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]wchar_t/i\\\n"
- "#ifndef __WCHAR_TYPE__\\\n"
- "#define __WCHAR_TYPE__ int\\\n"
- "#endif\\\n"
- "#ifndef __cplusplus\n";
-
- sed = "/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]wchar_t/a\\\n"
- "#endif\n";
-
- sed = "s/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]wchar_t/"
- "typedef __WCHAR_TYPE__ wchar_t/";
-};
-
-
-/*
- * Fix files that may contain a stray definition of size_t. Take care
- * not to match ssize_t or mere uses of size_t.
- */
-fix = {
- hackname = systypes_stdlib_size_t;
- files = sys/types.h;
- files = stdlib.h;
- select = "typedef[ \t]+[A-Za-z_][ \tA-Za-z_]*[ \t]size_t.*";
- bypass = "_(GCC|BSD)_SIZE_T";
-
- c_fix = format;
- c_fix_arg =
- "#ifndef _GCC_SIZE_T\n"
- "#define _GCC_SIZE_T\n%0\n#endif";
-
- test_text = "typedef unsigned int size_t; /* size of something */";
+ 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 = {
hackname = sysv68_string;
+ files = testing.h;
files = string.h;
sed = "s/extern[ \t]*int[ \t]*strlen();/extern unsigned int strlen();/";
sed = "s/extern[ \t]*int[ \t]*ffs[ \t]*(long);/extern int ffs(int);/";
sed = "s/strdup(char \\*s1);/strdup(const char *s1);/";
+
sed = "/^extern char$/N";
sed = "s/^extern char\\(\\n\t\\*memccpy(),\\)$/extern void\\1/";
- sed = "/^\tstrncmp(),$/N";
- sed = "s/^\\(\tstrncmp()\\),\\n\\(\tstrlen(),\\)$/\\1;\\\n"
- "extern unsigned int\\\n\\2/";
+
sed = "/^extern int$/N";
sed = "s/^extern int\\(\\n\tstrlen(),\\)/extern size_t\\1/";
+
+ sed = "/^\tstrncmp(),$/N";
+ sed = 's/^\(' "\t" 'strncmp()\),\n\(' "\t" 'strlen(),\)$/'
+ '\1;' "\\\nextern unsigned int\\\n\\2/";
+
+ test_text =
+ "extern int strlen();\n"
+
+ "extern int ffs(long);\n"
+
+ "extern char\n"
+ "\t*memccpy(),\n"
+ "\tmemcpy();\n"
+
+ "extern int\n"
+ "\tstrcmp(),\n"
+ "\tstrncmp(),\n"
+ "\tstrlen(),\n"
+ "\tstrspn();\n"
+
+ "extern int\n"
+ "\tstrlen(), strspn();";
};
/*
- * Fix this Sun file to avoid interfering with stddef.h.
- * We use a funny name to ensure it follows 'systypes' fix.
- */
-fix = {
- hackname = sysz_stdtypes_for_sun;
- files = sys/stdtypes.h;
- sed = "/[\t ]size_t.*;/i\\\n"
- "#ifndef _GCC_SIZE_T\\\n"
- "#define _GCC_SIZE_T\n";
-
- sed = "/[\t ]size_t.*;/a\\\n"
- "#endif\n";
-
- sed = "/[\t ]ptrdiff_t.*;/i\\\n"
- "#ifndef _GCC_PTRDIFF_T\\\n"
- "#define _GCC_PTRDIFF_T\n";
-
- sed = "/[\t ]ptrdiff_t.*;/a\\\n"
- "#endif\n";
-
- sed = "/[\t ]wchar_t.*;/i\\\n"
- "#ifndef _GCC_WCHAR_T\\\n"
- "#define _GCC_WCHAR_T\n";
-
- sed = "/[\t ]wchar_t.*;/a\\\n"
- "#endif\n";
-
- test_text = "typedef int size_t; /* ??? */\n"
- "typedef int ptrdiff_t; /* result of subtracting two pointers */\n"
- "typedef unsigned short wchar_t; /* big enough for biggest char set */\n";
-};
-
-
-/*
* if the #if says _cplusplus, not the double underscore __cplusplus
* that it should be
*/
* Strip "|| CC$gfloat" from Ultrix math headers.
*/
fix = {
- hackname = ultrix_math_ifdef;
- files = float.h;
- files = math.h;
- files = sys/limits.h;
- select = "^#if.*\\|\\|[ \t]+CC\\$[a-z]+";
- sed = "/^#if/s/||[ \t][ \t]*CC$[a-z][a-z]*//";
+ hackname = ultrix_math_ifdef;
+ files = sys/limits.h;
+ files = float.h;
+ files = math.h;
+ select = "^(#if.*)\\|\\|[ \t]+CC\\$[a-z]+";
+ c_fix = format;
+ c_fix_arg = "%1";
+
test_text = '#if defined(__GFLOAT) || CC\$gfloat';
};
* on those systems where the replacement byteorder header is installed.
*/
fix = {
- hackname = unixware7_byteorder_fix;
+ hackname = uw7_byteorder_fix;
files = arpa/inet.h;
select = "in_port_t";
+ test = "-f $DESTDIR/sys/byteorder.h";
#ifndef SVR5
mach = "*-*-sysv4*";
mach = "i?86-*-sysv5*";
mach = "powerpcle-*-solaris2.[0-4]";
mach = "sparc-*-solaris2.[0-4]";
#endif /* SVR5 */
- sed = '/^extern.*htons.*(in_port_t)/d';
- sed = '/^extern.*ntohs.*(in_port_t)/d';
+
+ c_fix = format;
+ c_fix_arg = "";
+ c_fix_arg = "^extern.*(htons|ntohs).*\\(in_port_t\\).*\n";
+
+ test_text = "extern htons(in_port_t);"
+ "`[ ! -d $DESTDIR/sys ] && mkdir $DESTDIR/sys\n"
+ "echo '/* DUMMY */' >> sys/byteorder.h\n"
+ "touch $DESTDIR/sys/byteorder.h`";
};
* we find __cplusplus in the file. These were found on the RS/6000.
*/
fix = {
- hackname = x11_class;
- files = X11/ShellP.h;
- bypass = __cplusplus;
- sed = "/char \\*class;/i\\\n"
- "#ifdef __cplusplus\\\n"
- "\tchar *c_class;\\\n"
- "#else\n";
- sed = "/char \\*class;/a\\\n"
- "#endif\n";
+ hackname = x11_class;
+ files = X11/ShellP.h;
+ bypass = __cplusplus;
+ select = "^([ \t]*char \\*)class;(.*)";
+ c_fix = format;
+ c_fix_arg = "#ifdef __cplusplus\n%1c_class;%2\n"
+ "#else\n%1class;%2\n#endif";
test_text =
"struct {\n"
" char *class;\n"