Commit 3be1fb72 by Zack Weinberg Committed by Zack Weinberg

inclhack.def: Fixes to play nicer with FreeBSD, and corrections to comments.

2000-01-25  Zack Weinberg  <zack@wolery.cumb.org>

	* inclhack.def: Fixes to play nicer with FreeBSD, and
	corrections to comments.
	(cxx_unready): Add select expression.
	(irix_sockaddr): Add bypass expression.
	(machine_ansi_h_va_list): New fix.
	(stdio_va_list): No need to edit _BSD_VA_LIST_.
	Split out addition of "#include <stdarg.h>" to...
	(stdio_stdarg_h): ... here.
	(systypes_for_aix): Rename to systypes_stdlib_size_t.  Apply
	to stdlib.h also.  Do not munge _BSD_SIZE_T_.
	(sysz_stdlib_for_sun): Delete duplicate fix for unprotected
	size_t.
	(ultrix_ifdef): Tighten up select expression.

	* fixincl.tpl: Exorcise 'exesel'.  Rewrite calculations of
	re_ct and max_mach to avoid use of shell.  Make printed names
	match names in inclhack.def.  Use static copyright date.
	Don't count c_test and test expressions as requiring regex_t
	slots.  Add some commentary.
	* inclhack.tpl: Do not include the 'This script contains N
	fixup scripts' line if PROGRAM is defined.  Use static
	copyright date.

From-SVN: r31604
parent 534170eb
2000-01-25 Zack Weinberg <zack@wolery.cumb.org>
* inclhack.def: Fixes to play nicer with FreeBSD, and
corrections to comments.
(cxx_unready): Add select expression.
(irix_sockaddr): Add bypass expression.
(machine_ansi_h_va_list): New fix.
(stdio_va_list): No need to edit _BSD_VA_LIST_.
Split out addition of "#include <stdarg.h>" to...
(stdio_stdarg_h): ... here.
(systypes_for_aix): Rename to systypes_stdlib_size_t. Apply
to stdlib.h also. Do not munge _BSD_SIZE_T_.
(sysz_stdlib_for_sun): Delete duplicate fix for unprotected
size_t.
(ultrix_ifdef): Tighten up select expression.
* fixincl.tpl: Exorcise 'exesel'. Rewrite calculations of
re_ct and max_mach to avoid use of shell. Make printed names
match names in inclhack.def. Use static copyright date.
Don't count c_test and test expressions as requiring regex_t
slots. Add some commentary.
* inclhack.tpl: Do not include the 'This script contains N
fixup scripts' line if PROGRAM is defined. Use static
copyright date.
2000-01-24 Jason Merrill <jason@casey.cygnus.com> 2000-01-24 Jason Merrill <jason@casey.cygnus.com>
* dwarf2out.c: include "varray.h", not dyn-string.h. * dwarf2out.c: include "varray.h", not dyn-string.h.
......
...@@ -6,11 +6,10 @@ ...@@ -6,11 +6,10 @@
# files which are fixed to work correctly with ANSI C and placed in a # files which are fixed to work correctly with ANSI C and placed in a
# directory that GNU C will search. # directory that GNU C will search.
# #
# This script contains 113 fixup scripts.
#
# See README-fixinc for more information. # See README-fixinc for more information.
# #
# fixincludes copyright (c) 2000 The Free Software Foundation, Inc. # fixincludes copyright (c) 1998, 1999, 2000
# The Free Software Foundation, Inc.
# #
# fixincludes is free software. # fixincludes is free software.
# #
......
...@@ -11,19 +11,27 @@ x =] ...@@ -11,19 +11,27 @@ x =]
* *
* See README-fixinc for more information. * See README-fixinc for more information.
* *
* inclhack copyright (c) [=_eval "date +%Y" _shell * inclhack copyright (c) 1998, 1999, 2000
=] The Free Software Foundation, Inc. * The Free Software Foundation, Inc.
* *
[=_eval inclhack "# * " _gpl=] [=_eval inclhack "# * " _gpl=]
*[=_EVAL "re_ct=0\nmax_mach=0" _shell=][= */
[= _SETENV re_ct 0 =][= _SETENV max_mach 0 =][=
_FOR fix =] _FOR fix =]
/* * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Description of [=hackname _Cap=] fix * Description of [=hackname _cap=] fix
*/ */[=
# Note that this is not just for debugging purposes, but in case
some C fix wishes to refer to the regexps it is paired with.
See commentary at the top of fixfixes.c.
=]
#define [=hackname _up #_FIXIDX + #%-32s _printf=] [=_eval _index=] #define [=hackname _up #_FIXIDX + #%-32s _printf=] [=_eval _index=]
tSCC z[=hackname _cap=]Name[] = tSCC z[=hackname _cap=]Name[] =
[=hackname _cap _krstr=]; [=hackname _krstr=];
/* /*
* File name selection pattern * File name selection pattern
*/[= */[=
...@@ -41,35 +49,21 @@ tSCC z[=hackname _cap=]List[] = ...@@ -41,35 +49,21 @@ tSCC z[=hackname _cap=]List[] =
_IF mach _exist=] _IF mach _exist=]
tSCC* apz[=hackname _cap=]Machs[] = {[= tSCC* apz[=hackname _cap=]Machs[] = {[=
_EVAL "this_mach=0" _shell =][= _SETENV this_mach 0 =][=
_FOR mach =] _FOR mach =]
[=mach _krstr=],[= [=mach _krstr=],[=
_EVAL mach _len "this_mach=`expr $this_mach + %d + 5`" _SETENV this_mach mach _len this_mach _env _val 5 + +
_printf _shell =][= =][= /mach=]
/mach=]
(const char*)NULL };[= (const char*)NULL };[=
_EVAL "if [ $this_mach -gt $max_mach ] ; then max_mach=$this_mach ; fi" _SETENV max_mach _mark this_mach _env _val max_mach _env _val _max =][=
_shell =][=
_ELSE =] _ELSE =]
#define apz[=hackname _cap=]Machs (const char**)NULL[= #define apz[=hackname _cap=]Machs (const char**)NULL[=
_ENDIF "files _exist" =][= _ENDIF "files _exist" =][=
_IF exesel _exist=] _IF select _exist=]
/*
* content selection pattern - do fix if pattern found
* This is a special pattern that not all egrep commands
* are capable of coping with. We use the GNU library, tho :)
*/[=
_FOR exesel =]
tSCC z[=hackname _cap=]Select[=_eval _index=][] =
[=exesel _krstr=];[=
/exesel =][=
_ELIF select _exist=]
/* /*
* content selection pattern - do fix if pattern found * content selection pattern - do fix if pattern found
...@@ -115,29 +109,21 @@ tSCC z[=hackname _cap=]FTst[=_eval _index=][] = "[=c_test=]";[= ...@@ -115,29 +109,21 @@ tSCC z[=hackname _cap=]FTst[=_eval _index=][] = "[=c_test=]";[=
# Build the array of test descriptions for this fix: =][= # Build the array of test descriptions for this fix: =][=
_IF exesel _exist _IF select _exist
select _exist |
bypass _exist | bypass _exist |
test _exist | test _exist |
c_test _exist | c_test _exist |
=] =]
#define [=hackname _up =]_TEST_CT [= #define [=hackname _up =]_TEST_CT [=
_IF exesel _exist =][=
_eval exesel _count
bypass _count +
test _count +
c_test _count +
"ct=%d ; re_ct=`expr $ct + $re_ct` ; echo $ct"
_printf _shell =][=
_ELSE =][=
_eval select _count _eval select _count
bypass _count + bypass _count +
test _count + test _count +
c_test _count + c_test _count + =][=
"ct=%d ; re_ct=`expr $ct + $re_ct` ; echo $ct" _SETENV re_ct
_printf _shell =][= re_ct _env _val
_ENDIF =] select _count +
bypass _count + =]
tTestDesc a[=hackname _cap=]Tests[] = {[= tTestDesc a[=hackname _cap=]Tests[] = {[=
_FOR test =] _FOR test =]
...@@ -152,19 +138,9 @@ tTestDesc a[=hackname _cap=]Tests[] = {[= ...@@ -152,19 +138,9 @@ tTestDesc a[=hackname _cap=]Tests[] = {[=
{ TT_NEGREP, z[=hackname _cap=]Bypass[=_eval _index=], (regex_t*)NULL },[= { TT_NEGREP, z[=hackname _cap=]Bypass[=_eval _index=], (regex_t*)NULL },[=
/bypass =][= /bypass =][=
# IF there is an exesel, then use that (those) selection
expressions, instead of the regular select expressions
=][=
_IF exesel _exist =][=
_FOR exesel =]
{ TT_EGREP, z[=hackname _cap=]Select[=_eval _index=], (regex_t*)NULL },[=
/exesel =][=
_ELSE =][=
_FOR select =] _FOR select =]
{ TT_EGREP, z[=hackname _cap=]Select[=_eval _index=], (regex_t*)NULL },[= { TT_EGREP, z[=hackname _cap=]Select[=_eval _index=], (regex_t*)NULL },[=
/select =][= /select =] };[=
_ENDIF =] };[=
_ELSE =] _ELSE =]
#define [=hackname _up=]_TEST_CT 0 #define [=hackname _up=]_TEST_CT 0
#define a[=hackname _cap=]Tests (tTestDesc*)NULL[= #define a[=hackname _cap=]Tests (tTestDesc*)NULL[=
...@@ -189,21 +165,19 @@ const char* apz[=hackname _cap=]Patch[] = {[= ...@@ -189,21 +165,19 @@ const char* apz[=hackname _cap=]Patch[] = {[=
_ENDIF=] _ENDIF=]
(char*)NULL }; (char*)NULL };
[=/fix=]
/* * * * * * * * * * * * * * * * * * * * * * * * * *[= /* * * * * * * * * * * * * * * * * * * * * * * * * *
/fix=]
* *
* List of all fixes * List of all fixes
*/ */[=
[=_EVAL '
echo "#define REGEX_COUNT $re_ct"
echo "#define MACH_LIST_SIZE_LIMIT `expr $max_mach + 128`" ' _shell =][=
# as of this writing, 49 bytes are needed by the case statement format. # as of this writing, 49 bytes are needed by the case statement format.
We also must allow for the size of the target machine machine name. We also must allow for the size of the target machine machine name.
This allows for a 79 byte machine name. Better be enough. This allows for a 79 byte machine name. Better be enough.
=] =]
#define FIX_COUNT [=_eval fix _count =] #define REGEX_COUNT [= _eval re_ct _env =]
#define MACH_LIST_SIZE_LIMIT [= _eval max_mach _env _val 128 + =]
#define FIX_COUNT [= _eval fix _count =]
tFixDesc fixDescList[ FIX_COUNT ] = {[= tFixDesc fixDescList[ FIX_COUNT ] = {[=
......
...@@ -861,6 +861,8 @@ fix = { ...@@ -861,6 +861,8 @@ fix = {
hackname = cxx_unready; hackname = cxx_unready;
files = sys/mman.h; files = sys/mman.h;
files = rpc/types.h; files = rpc/types.h;
select = '[^#]+malloc.*;'; /* Should catch any form of a declaration
but not mention within a macro. */
bypass = '"C"|__BEGIN_DECLS'; bypass = '"C"|__BEGIN_DECLS';
sed = "1i\\\n" sed = "1i\\\n"
...@@ -1012,8 +1014,7 @@ fix = { ...@@ -1012,8 +1014,7 @@ fix = {
/* /*
* IRIX 4.0.5 <rpc/auth.h> uses struct sockaddr * Some IRIX header files contain the string "//"
* in prototype without previous definition.
*/ */
fix = { fix = {
hackname = irix_multiline_cmnt; hackname = irix_multiline_cmnt;
...@@ -1025,12 +1026,14 @@ fix = { ...@@ -1025,12 +1026,14 @@ fix = {
/* /*
* Some IRIX header files contain the string "//" * IRIX 4.0.5 <rpc/auth.h> uses struct sockaddr
* in prototype without previous definition.
*/ */
fix = { fix = {
hackname = irix_sockaddr; hackname = irix_sockaddr;
files = rpc/auth.h; files = rpc/auth.h;
select = "authdes_create.*struct sockaddr"; select = "authdes_create.*struct sockaddr";
bypass = "<sys/socket\.h>";
sed = "/authdes_create.*struct sockaddr/i\\\n" sed = "/authdes_create.*struct sockaddr/i\\\n"
"struct sockaddr;\n"; "struct sockaddr;\n";
}; };
...@@ -1252,6 +1255,19 @@ fix = { ...@@ -1252,6 +1255,19 @@ fix = {
/* /*
* Fix BSD machine/ansi.h to use __builtin_va_list to define _BSD_VA_LIST_.
*/
fix = {
hackname = machine_ansi_h_va_list;
files = machine/ansi.h;
select = '_BSD_VA_LIST_';
bypass = '__builtin_va_list';
sed = "s/\\(_BSD_VA_LIST_[ \t][ \t]*\\).*$/\\1__builtin_va_list/";
};
/*
* Fix non-ansi machine name defines * Fix non-ansi machine name defines
*/ */
fix = { fix = {
...@@ -1641,6 +1657,7 @@ fix = { ...@@ -1641,6 +1657,7 @@ fix = {
}; };
#endif #endif
/* /*
* a missing semi-colon at the end of the statsswtch structure definition. * a missing semi-colon at the end of the statsswtch structure definition.
*/ */
...@@ -1653,41 +1670,51 @@ fix = { ...@@ -1653,41 +1670,51 @@ fix = {
/* /*
* 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)";
sed = '1i\\
\#define __need___va_list\\
\#include <stdarg.h>
';
};
/*
* Don't use or define the name va_list in stdio.h. * Don't use or define the name va_list in stdio.h.
* This is for ANSI and also to interoperate properly with gcc's varargs.h. * This is for ANSI and also to interoperate properly with gcc's varargs.h.
* Arrange for stdio.h to use stdarg.h to define __gnuc_va_list * Note _BSD_VA_LIST_ is dealt with elsewhere.
*/ */
fix = { fix = {
hackname = stdio_va_list; hackname = stdio_va_list;
files = stdio.h; files = stdio.h;
bypass = "__gnuc_va_list"; bypass = '__gnuc_va_list|_BSD_VA_LIST_';
/* /*
* Use __gnuc_va_list in arg types in place of va_list. * Use __gnuc_va_list in arg types in place of va_list.
* On 386BSD use __gnuc_va_list instead of _VA_LIST_. We're hoping the * On 386BSD use __gnuc_va_list instead of _VA_LIST_. We're hoping the
* trailing parentheses and semicolon save all other systems from this. * trailing parentheses and semicolon save all other systems from this.
* Define __not_va_list__ (something harmless and unused) instead of va_list. * Define __not_va_list__ (something harmless and unused)
* instead of va_list.
* Don't claim to have defined va_list. * Don't claim to have defined va_list.
*/ */
shell = sed = "s@ va_list @ __gnuc_va_list @\n"
"if ( egrep \"__need___va_list\" $file ) > /dev/null 2>&1 ; then "s@ va_list)@ __gnuc_va_list)@\n"
: "s@ _VA_LIST_));@ __gnuc_va_list));@\n"
else "s@ va_list@ __not_va_list__@\n"
echo \"#define __need___va_list\" "s@\\*va_list@*__not_va_list__@\n"
echo \"#include <stdarg.h>\" "s@ __va_list)@ __gnuc_va_list)@\n"
fi "s@GNUC_VA_LIST@GNUC_Va_LIST@\n"
"s@_NEED___VA_LIST@_NEED___Va_LIST@\n"
sed -e 's@ va_list @ __gnuc_va_list @' \\ "s@VA_LIST@DUMMY_VA_LIST@\n"
-e 's@ va_list)@ __gnuc_va_list)@' \\ "s@_Va_LIST@_VA_LIST@";
-e 's@ _BSD_VA_LIST_))@ __gnuc_va_list))@' \\
-e 's@ _VA_LIST_));@ __gnuc_va_list));@' \\
-e 's@ va_list@ __not_va_list__@' \\
-e 's@\\*va_list@*__not_va_list__@' \\
-e 's@ __va_list)@ __gnuc_va_list)@' \\
-e 's@GNUC_VA_LIST@GNUC_Va_LIST@' \\
-e 's@_NEED___VA_LIST@_NEED___Va_LIST@' \\
-e 's@VA_LIST@DUMMY_VA_LIST@' \\
-e 's@_Va_LIST@_VA_LIST@'";
}; };
...@@ -2175,14 +2202,8 @@ fix = { ...@@ -2175,14 +2202,8 @@ fix = {
}; };
#endif /* SVR5 */ #endif /* SVR5 */
/* Fix these files to use the same types that we think they should.
/* * XXX - extremely dubious changes here.
* Fix return value of mem{ccpy,chr,cpy,set} and str{len,spn,cspn}
* in string.h on sysV68
* Correct the return type for strlen in string.h on Lynx.
* Correct the argument type for ffs in string.h on Alpha OSF/1 V2.0.
* Add missing const for strdup on OSF/1 V3.0.
* On sysV88 layout is slightly different.
*/ */
fix = { fix = {
hackname = systypes; hackname = systypes;
...@@ -2235,15 +2256,15 @@ fix = { ...@@ -2235,15 +2256,15 @@ fix = {
/* /*
* Fix this file to avoid interfering with stddef.h, * Fix files that may contain a stray definition of size_t. Take care
* but don't mistakenly match ssize_t present in AIX for the ps/2, * not to match ssize_t or mere uses of size_t.
* or typedefs which use (but do not set) size_t.
*/ */
fix = { fix = {
hackname = systypes_for_aix; hackname = systypes_stdlib_size_t;
files = sys/types.h; files = sys/types.h;
files = stdlib.h;
select = "typedef[ \t][ \t]*[A-Za-z_][ \tA-Za-z_]*[ \t]size_t"; select = "typedef[ \t][ \t]*[A-Za-z_][ \tA-Za-z_]*[ \t]size_t";
bypass = "_GCC_SIZE_T"; bypass = "_(GCC|BSD)_SIZE_T";
sed = "/typedef[ \t][ \t]*[A-Za-z_][ \tA-Za-z_]*[ \t]size_t/i\\\n" sed = "/typedef[ \t][ \t]*[A-Za-z_][ \tA-Za-z_]*[ \t]size_t/i\\\n"
"#ifndef _GCC_SIZE_T\\\n" "#ifndef _GCC_SIZE_T\\\n"
...@@ -2255,9 +2276,12 @@ fix = { ...@@ -2255,9 +2276,12 @@ fix = {
/* /*
* Fix return type of exit and abort in <stdlib.h> on SunOS 4.1. * Fix return value of mem{ccpy,chr,cpy,set} and str{len,spn,cspn}
* Also wrap protection around size_t for m88k-sysv3 systems. * in string.h on sysV68
* We use a funny name to ensure it follows 'systypes' fix. * Correct the return type for strlen in string.h on Lynx.
* Correct the argument type for ffs in string.h on Alpha OSF/1 V2.0.
* Add missing const for strdup on OSF/1 V3.0.
* On sysV88 layout is slightly different.
*/ */
fix = { fix = {
hackname = sysv68_string; hackname = sysv68_string;
...@@ -2278,7 +2302,6 @@ fix = { ...@@ -2278,7 +2302,6 @@ fix = {
/* /*
* Fix return type of exit and abort in <stdlib.h> * Fix return type of exit and abort in <stdlib.h>
* Also wrap protection around size_t.
*/ */
fix = { fix = {
hackname = sysz_stdlib_for_sun; hackname = sysz_stdlib_for_sun;
...@@ -2291,13 +2314,6 @@ fix = { ...@@ -2291,13 +2314,6 @@ fix = {
sed = "s/char[ \t]*\\*[ \t]*realloc/void \\*\trealloc/g"; sed = "s/char[ \t]*\\*[ \t]*realloc/void \\*\trealloc/g";
sed = "s/char[ \t]*\\*[ \t]*bsearch/void \\*\tbsearch/g"; sed = "s/char[ \t]*\\*[ \t]*bsearch/void \\*\tbsearch/g";
sed = "s/int[ \t][ \t]*exit/void\texit/g"; sed = "s/int[ \t][ \t]*exit/void\texit/g";
sed = "/typedef[ \ta-zA-Z_]*[ \t]size_t[ \t]*;/i\\\n"
"#ifndef _GCC_SIZE_T\\\n"
"#define _GCC_SIZE_T\n";
sed = "/typedef[ \ta-zA-Z_]*[ \t]size_t[ \t]*;/a\\\n"
"#endif\n";
}; };
...@@ -2395,7 +2411,7 @@ fix = { ...@@ -2395,7 +2411,7 @@ fix = {
*/ */
fix = { fix = {
hackname = ultrix_ifdef; hackname = ultrix_ifdef;
select = "#ifdef KERNEL"; select = "#ifdef KERNEL[ \t]*[^ \t]";
files = sys/file.h; files = sys/file.h;
sed = "s/#ifdef KERNEL/#if defined(KERNEL)/"; sed = "s/#ifdef KERNEL/#if defined(KERNEL)/";
}; };
......
...@@ -6,11 +6,12 @@ ...@@ -6,11 +6,12 @@
# files which are fixed to work correctly with ANSI C and placed in a # files which are fixed to work correctly with ANSI C and placed in a
# directory that GNU C will search. # directory that GNU C will search.
# #
# This script contains 113 fixup scripts. # This script contains 115 fixup scripts.
# #
# See README-fixinc for more information. # See README-fixinc for more information.
# #
# fixincludes copyright (c) 2000 The Free Software Foundation, Inc. # fixincludes copyright (c) 1998, 1999, 2000
# The Free Software Foundation, Inc.
# #
# fixincludes is free software. # fixincludes is free software.
# #
...@@ -1392,6 +1393,8 @@ extern "C"\ ...@@ -1392,6 +1393,8 @@ extern "C"\
# #
case "${file}" in ./sys/mman.h | \ case "${file}" in ./sys/mman.h | \
./rpc/types.h ) ./rpc/types.h )
if ( test -n "`egrep '[^#]+malloc.*;' ${file}`"
) > /dev/null 2>&1 ; then
if ( test -z "`egrep '\"C\"|__BEGIN_DECLS' ${file}`" if ( test -z "`egrep '\"C\"|__BEGIN_DECLS' ${file}`"
) > /dev/null 2>&1 ; then ) > /dev/null 2>&1 ; then
fixlist="${fixlist} fixlist="${fixlist}
...@@ -1415,6 +1418,7 @@ extern "C" {\ ...@@ -1415,6 +1418,7 @@ extern "C" {\
rm -f ${DESTFILE} rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
fi # end of bypass 'if' fi # end of bypass 'if'
fi # end of select 'if'
;; # case end for file name test ;; # case end for file name test
esac esac
...@@ -1644,6 +1648,8 @@ extern "C" {\ ...@@ -1644,6 +1648,8 @@ extern "C" {\
case "${file}" in ./rpc/auth.h ) case "${file}" in ./rpc/auth.h )
if ( test -n "`egrep 'authdes_create.*struct sockaddr' ${file}`" if ( test -n "`egrep 'authdes_create.*struct sockaddr' ${file}`"
) > /dev/null 2>&1 ; then ) > /dev/null 2>&1 ; then
if ( test -z "`egrep '<sys/socket.h>' ${file}`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist} fixlist="${fixlist}
irix_sockaddr" irix_sockaddr"
if [ ! -r ${DESTFILE} ] if [ ! -r ${DESTFILE} ]
...@@ -1656,6 +1662,7 @@ struct sockaddr; ...@@ -1656,6 +1662,7 @@ struct sockaddr;
< $infile > ${DESTDIR}/fixinc.tmp < $infile > ${DESTDIR}/fixinc.tmp
rm -f ${DESTFILE} rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
fi # end of bypass 'if'
fi # end of select 'if' fi # end of select 'if'
;; # case end for file name test ;; # case end for file name test
esac esac
...@@ -2000,6 +2007,30 @@ static __inline__ double fake_hypot (x, y)\ ...@@ -2000,6 +2007,30 @@ static __inline__ double fake_hypot (x, y)\
# #
# Fix Machine_Ansi_H_Va_List
#
case "${file}" in ./machine/ansi.h )
if ( test -n "`egrep '_BSD_VA_LIST_' ${file}`"
) > /dev/null 2>&1 ; then
if ( test -z "`egrep '__builtin_va_list' ${file}`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
machine_ansi_h_va_list"
if [ ! -r ${DESTFILE} ]
then infile=${file}
else infile=${DESTFILE} ; fi
sed -e 's/\(_BSD_VA_LIST_[ ][ ]*\).*$/\1__builtin_va_list/' \
< $infile > ${DESTDIR}/fixinc.tmp
rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
fi # end of bypass 'if'
fi # end of select 'if'
;; # case end for file name test
esac
#
# Fix Machine_Name # Fix Machine_Name
# #
if ${FIXTESTS} ${file} machine_name if ${FIXTESTS} ${file} machine_name
...@@ -2469,40 +2500,52 @@ typedef __regmatch_t regmatch_t; ...@@ -2469,40 +2500,52 @@ typedef __regmatch_t regmatch_t;
# #
# Fix Stdio_Va_List # Fix Stdio_Stdarg_H
# #
case "${file}" in ./stdio.h ) case "${file}" in ./stdio.h )
if ( test -z "`egrep '__gnuc_va_list' ${file}`" if ( test -z "`egrep 'include.*(stdarg.h|machine/ansi.h)' ${file}`"
) > /dev/null 2>&1 ; then ) > /dev/null 2>&1 ; then
fixlist="${fixlist} fixlist="${fixlist}
stdio_va_list" stdio_stdarg_h"
if [ ! -r ${DESTFILE} ] if [ ! -r ${DESTFILE} ]
then infile=${file} then infile=${file}
else infile=${DESTFILE} ; fi else infile=${DESTFILE} ; fi
( if ( egrep "__need___va_list" $file ) > /dev/null 2>&1 ; then
:
else
echo "#define __need___va_list"
echo "#include <stdarg.h>"
fi
sed -e 's@ va_list @ __gnuc_va_list @' \ sed -e '1i\
-e 's@ va_list)@ __gnuc_va_list)@' \ #define __need___va_list\
-e 's@ _BSD_VA_LIST_))@ __gnuc_va_list))@' \ #include <stdarg.h>
-e 's@ _VA_LIST_));@ __gnuc_va_list));@' \ ' \
-e 's@ va_list@ __not_va_list__@' \ < $infile > ${DESTDIR}/fixinc.tmp
-e 's@\*va_list@*__not_va_list__@' \ rm -f ${DESTFILE}
-e 's@ __va_list)@ __gnuc_va_list)@' \ mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
-e 's@GNUC_VA_LIST@GNUC_Va_LIST@' \ fi # end of bypass 'if'
-e 's@_NEED___VA_LIST@_NEED___Va_LIST@' \ ;; # case end for file name test
-e 's@VA_LIST@DUMMY_VA_LIST@' \ esac
-e 's@_Va_LIST@_VA_LIST@' ) < $infile > ${DESTDIR}/fixinc.tmp
# Shell scripts have the potential of removing the output
# We interpret that to mean the file is not to be altered
# #
if test ! -f ${DESTDIR}/fixinc.tmp # Fix Stdio_Va_List
then continue ; fi #
case "${file}" in ./stdio.h )
if ( test -z "`egrep '__gnuc_va_list|_BSD_VA_LIST_' ${file}`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
stdio_va_list"
if [ ! -r ${DESTFILE} ]
then infile=${file}
else infile=${DESTFILE} ; fi
sed -e 's@ va_list @ __gnuc_va_list @
s@ va_list)@ __gnuc_va_list)@
s@ _VA_LIST_));@ __gnuc_va_list));@
s@ va_list@ __not_va_list__@
s@\*va_list@*__not_va_list__@
s@ __va_list)@ __gnuc_va_list)@
s@GNUC_VA_LIST@GNUC_Va_LIST@
s@_NEED___VA_LIST@_NEED___Va_LIST@
s@VA_LIST@DUMMY_VA_LIST@
s@_Va_LIST@_VA_LIST@' \
< $infile > ${DESTDIR}/fixinc.tmp
rm -f ${DESTFILE} rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
fi # end of bypass 'if' fi # end of bypass 'if'
...@@ -2781,15 +2824,16 @@ typedef __SIZE_TYPE__ size_t;\ ...@@ -2781,15 +2824,16 @@ typedef __SIZE_TYPE__ size_t;\
# #
# Fix Systypes_For_Aix # Fix Systypes_Stdlib_Size_T
# #
case "${file}" in ./sys/types.h ) case "${file}" in ./sys/types.h | \
./stdlib.h )
if ( test -n "`egrep 'typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t' ${file}`" if ( test -n "`egrep 'typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t' ${file}`"
) > /dev/null 2>&1 ; then ) > /dev/null 2>&1 ; then
if ( test -z "`egrep '_GCC_SIZE_T' ${file}`" if ( test -z "`egrep '_(GCC|BSD)_SIZE_T' ${file}`"
) > /dev/null 2>&1 ; then ) > /dev/null 2>&1 ; then
fixlist="${fixlist} fixlist="${fixlist}
systypes_for_aix" systypes_stdlib_size_t"
if [ ! -r ${DESTFILE} ] if [ ! -r ${DESTFILE} ]
then infile=${file} then infile=${file}
else infile=${DESTFILE} ; fi else infile=${DESTFILE} ; fi
...@@ -2855,13 +2899,6 @@ extern unsigned int\ ...@@ -2855,13 +2899,6 @@ extern unsigned int\
-e 's/char[ ]*\*[ ]*realloc/void \* realloc/g' \ -e 's/char[ ]*\*[ ]*realloc/void \* realloc/g' \
-e 's/char[ ]*\*[ ]*bsearch/void \* bsearch/g' \ -e 's/char[ ]*\*[ ]*bsearch/void \* bsearch/g' \
-e 's/int[ ][ ]*exit/void exit/g' \ -e 's/int[ ][ ]*exit/void exit/g' \
-e '/typedef[ a-zA-Z_]*[ ]size_t[ ]*;/i\
#ifndef _GCC_SIZE_T\
#define _GCC_SIZE_T
' \
-e '/typedef[ a-zA-Z_]*[ ]size_t[ ]*;/a\
#endif
' \
< $infile > ${DESTDIR}/fixinc.tmp < $infile > ${DESTDIR}/fixinc.tmp
rm -f ${DESTFILE} rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
...@@ -3002,7 +3039,7 @@ struct utsname; ...@@ -3002,7 +3039,7 @@ struct utsname;
# Fix Ultrix_Ifdef # Fix Ultrix_Ifdef
# #
case "${file}" in ./sys/file.h ) case "${file}" in ./sys/file.h )
if ( test -n "`egrep '#ifdef KERNEL' ${file}`" if ( test -n "`egrep '#ifdef KERNEL[ ]*[^ ]' ${file}`"
) > /dev/null 2>&1 ; then ) > /dev/null 2>&1 ; then
fixlist="${fixlist} fixlist="${fixlist}
ultrix_ifdef" ultrix_ifdef"
......
...@@ -10,13 +10,15 @@ sh ...@@ -10,13 +10,15 @@ sh
# Install modified versions of certain ANSI-incompatible system header # Install modified versions of certain ANSI-incompatible system header
# files which are fixed to work correctly with ANSI C and placed in a # files which are fixed to work correctly with ANSI C and placed in a
# directory that GNU C will search. # directory that GNU C will search.
# #[=
_IF PROGRAM _env ! =]
# This script contains [=_eval fix _count =] fixup scripts. # This script contains [=_eval fix _count =] fixup scripts.
# #[=
_ENDIF =]
# See README-fixinc for more information. # See README-fixinc for more information.
# #
# fixincludes copyright (c) [=_eval "date +%Y" _shell # fixincludes copyright (c) 1998, 1999, 2000
=] The Free Software Foundation, Inc. # The Free Software Foundation, Inc.
# #
[=_eval fixincludes "## " _gpl=] [=_eval fixincludes "## " _gpl=]
# #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment