Commit b51207a4 by Zack Weinberg

fixlib.c: Add copyright notice.

	* fixinc/fixlib.c: Add copyright notice.
	(compile_re): New function.
	* fixinc/fixlib.h: Prototype compile_re.

	* fixinc/fixfixes.c, fixinc/fixtests.c, fixinc/fixincl.c:
	Use compile_re to compile regular expressions.

	* fixinc/fixincl.c (egrep_test): Don't bother asking regexec
	where the pattern matched.

	* fixinc/inclhack.def (sun_memcpy): Move to AAB_sun_memcpy,
	use 'replace'.
	(ultrix_ansi_compat): Likewise.
	(interactv_add1): Rename to 'isc_omits_with_stdc', remove shell test,
	add egrep test.
	(interactv_add2, interactv_add3): Delete.
	(x11_sprintf): Don't use filename glob.
	* fixinc/fixincl.x, fixinc/inclhack.sh, fixinc/fixincl.sh:
	Regenerate.

From-SVN: r31474
parent 051e6fd7
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Test to see if a particular fix should be applied to a header file. Test to see if a particular fix should be applied to a header file.
Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
...@@ -191,9 +191,8 @@ FIX_PROC_HEAD( else_endif_label_fix ) ...@@ -191,9 +191,8 @@ FIX_PROC_HEAD( else_endif_label_fix )
char* pz_next = (char*)NULL; char* pz_next = (char*)NULL;
regmatch_t match[2]; regmatch_t match[2];
re_set_syntax (RE_SYNTAX_EGREP); compile_re (label_pat, &label_re, 1,
(void)re_compile_pattern (label_pat, sizeof (label_pat)-1, "label pattern", "else_endif_label_fix");
&label_re);
for (;;) /* entire file */ for (;;) /* entire file */
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
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.
Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -533,8 +533,6 @@ load_file ( fname ) ...@@ -533,8 +533,6 @@ load_file ( fname )
void void
run_compiles () run_compiles ()
{ {
tSCC z_bad_comp[] = "fixincl ERROR: cannot compile %s regex for %s\n\
\texpr = `%s'\n\terror %s\n";
tFixDesc *p_fixd = fixDescList; tFixDesc *p_fixd = fixDescList;
int fix_ct = FIX_COUNT; int fix_ct = FIX_COUNT;
tTestDesc *p_test; tTestDesc *p_test;
...@@ -550,26 +548,13 @@ run_compiles () ...@@ -550,26 +548,13 @@ run_compiles ()
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
/* Make sure re_compile_pattern does not stumble across invalid /* Make sure compile_re does not stumble across invalid data */
data */
memset ( (void*)p_re, '\0', REGEX_COUNT * sizeof (regex_t) ); memset ( (void*)p_re, '\0', REGEX_COUNT * sizeof (regex_t) );
memset ( (void*)&incl_quote_re, '\0', sizeof (regex_t) ); memset ( (void*)&incl_quote_re, '\0', sizeof (regex_t) );
/* The patterns we search for are all egrep patterns. compile_re (incl_quote_pat, &incl_quote_re, 1,
In the shell version of this program, we invoke egrep "quoted include", "run_compiles");
with the supplied pattern. Here, we will run
re_compile_pattern, but it must be using the same rules. */
re_set_syntax (RE_SYNTAX_EGREP);
pz_err = re_compile_pattern (incl_quote_pat, sizeof (incl_quote_pat)-1,
&incl_quote_re);
if (pz_err != (char *) NULL)
{
fprintf (stderr, z_bad_comp, "quoted include", "run_compiles",
incl_quote_pat, pz_err);
exit (EXIT_FAILURE);
}
/* FOR every fixup, ... */ /* FOR every fixup, ... */
do do
...@@ -669,16 +654,9 @@ run_compiles () ...@@ -669,16 +654,9 @@ run_compiles ()
} }
p_test->p_test_regex = p_re++; p_test->p_test_regex = p_re++;
pz_err = re_compile_pattern (p_test->pz_test_text, compile_re (p_test->pz_test_text, p_test->p_test_regex, 0,
strlen (p_test->pz_test_text), "select test", p_fixd->fix_name);
p_test->p_test_regex); }
if (pz_err != (char *) NULL)
{
fprintf (stderr, z_bad_comp, "select test", p_fixd->fix_name,
p_test->pz_test_text, pz_err);
exit (EXIT_FAILURE);
}
}
p_test++; p_test++;
} }
} }
...@@ -815,14 +793,12 @@ egrep_test (pz_data, p_test) ...@@ -815,14 +793,12 @@ egrep_test (pz_data, p_test)
char *pz_data; char *pz_data;
tTestDesc *p_test; tTestDesc *p_test;
{ {
regmatch_t match;
#ifdef DEBUG #ifdef DEBUG
if (p_test->p_test_regex == 0) if (p_test->p_test_regex == 0)
fprintf (stderr, "fixincl ERROR RE not compiled: `%s'\n", fprintf (stderr, "fixincl ERROR RE not compiled: `%s'\n",
p_test->pz_test_text); p_test->pz_test_text);
#endif #endif
if (regexec (p_test->p_test_regex, pz_data, 1, &match, 0) == 0) if (regexec (p_test->p_test_regex, pz_data, 0, 0, 0) == 0)
return APPLY_FIX; return APPLY_FIX;
return SKIP_FIX; return SKIP_FIX;
} }
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
# 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 114 fixup scripts. # This script contains 112 fixup scripts.
# #
# See README-fixinc for more information. # See README-fixinc for more information.
# #
# fixincludes copyright (c) 1999 The Free Software Foundation, Inc. # fixincludes copyright (c) 2000 The Free Software Foundation, Inc.
# #
# fixincludes is free software. # fixincludes is free software.
# #
......
/* Install modified versions of certain ANSI-incompatible system header
files which are fixed to work correctly with ANSI C and placed in a
directory that GNU C will search.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "fixlib.h" #include "fixlib.h"
/* * * * * * * * * * * * * /* * * * * * * * * * * * *
...@@ -128,3 +151,39 @@ is_cxx_header (fname, text) ...@@ -128,3 +151,39 @@ is_cxx_header (fname, text)
return BOOL_FALSE; return BOOL_FALSE;
} }
/* * * * * * * * * * * * *
Compile one regular expression pattern for later use. PAT contains
the pattern, RE points to a regex_t structure (which should have
been bzeroed). MATCH is 1 if we need to know where the regex
matched, 0 if not. If regcomp fails, prints an error message and
aborts; E1 and E2 are strings to shove into the error message.
The patterns we search for are all egrep patterns.
REG_EXTENDED|REG_NEWLINE produces identical regex syntax/semantics
to egrep (verified from 4.4BSD Programmer's Reference Manual). */
void
compile_re( pat, re, match, e1, e2 )
tCC *pat;
regex_t *re;
int match;
tCC *e1;
tCC *e2;
{
tSCC z_bad_comp[] = "fixincl ERROR: cannot compile %s regex for %s\n\
\texpr = `%s'\n\terror %s\n";
int flags, err;
flags = (match ? REG_EXTENDED|REG_NEWLINE
: REG_EXTENDED|REG_NEWLINE|REG_NOSUB);
err = regcomp (re, pat, flags);
if (err)
{
char rerrbuf[1024];
regerror (err, re, rerrbuf, 1024);
fprintf (stderr, z_bad_comp, e1, e2, pat, rerrbuf);
exit (EXIT_FAILURE);
}
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
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.
Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -97,5 +97,6 @@ typedef int apply_fix_p_t; /* Apply Fix Predicate Type */ ...@@ -97,5 +97,6 @@ typedef int apply_fix_p_t; /* Apply Fix Predicate Type */
*/ */
char * load_file_data _P_(( FILE* fp )); char * load_file_data _P_(( FILE* fp ));
t_bool is_cxx_header _P_(( tCC* filename, tCC* filetext )); t_bool is_cxx_header _P_(( tCC* filename, tCC* filetext ));
void compile_re _P_(( tCC* pat, regex_t* re, int match,
tCC *e1, tCC *e2 ));
#endif /* FIXINCLUDES_FIXLIB_H */ #endif /* FIXINCLUDES_FIXLIB_H */
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Test to see if a particular fix should be applied to a header file. Test to see if a particular fix should be applied to a header file.
Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
...@@ -164,9 +164,8 @@ TEST_FOR_FIX_PROC_HEAD( else_endif_label_test ) ...@@ -164,9 +164,8 @@ TEST_FOR_FIX_PROC_HEAD( else_endif_label_test )
if (! compiled) if (! compiled)
{ {
compiled++; compiled++;
re_set_syntax (RE_SYNTAX_EGREP); compile_re (label_pat, &label_re, 1,
(void)re_compile_pattern (label_pat, sizeof (label_pat)-1, "label pattern", "else_endif_label_test");
&label_re);
} }
for (;;) /* entire file */ for (;;) /* entire file */
......
...@@ -283,6 +283,45 @@ fix = { ...@@ -283,6 +283,45 @@ fix = {
/* /*
* 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.
* To ensure only Sun's is fixed, we grep for a likely unique string.
* Fix also on sysV68 R3V7.1 (head/memory.h\t50.1\t )
*/
fix = {
hackname = AAB_sun_memcpy;
files = memory.h;
select = "/\\*\t@\\(#\\)"
"(head/memory.h\t50.1\t "
"|memory\\.h 1\\.[2-4] 8./../.. SMI; from S5R2 1\\.2\t)\\*/";
replace =
'/* This file was generated by fixincludes */
\#ifndef __memory_h__
\#define __memory_h__
\#ifdef __STDC__
extern void *memccpy();
extern void *memchr();
extern void *memcpy();
extern void *memset();
\#else
extern char *memccpy();
extern char *memchr();
extern char *memcpy();
extern char *memset();
\#endif /* __STDC__ */
extern int memcmp();
\#endif /* __memory_h__ */
';
};
/*
* Completely replace <sys/byteorder.h>; with a file that implements gcc's * Completely replace <sys/byteorder.h>; with a file that implements gcc's
* optimized byteswapping. Restricted to "SVR4" machines until either * optimized byteswapping. Restricted to "SVR4" machines until either
* it is shown to be safe to replace this file always, or we get bolder ;-) * it is shown to be safe to replace this file always, or we get bolder ;-)
...@@ -469,6 +508,17 @@ fix = { ...@@ -469,6 +508,17 @@ fix = {
/* /*
* Cancel out ansi_compat.h on Ultrix. Replace it with an empty file.
*/
fix = {
hackname = AAB_ultrix_ansi_compat;
files = ansi_compat.h;
select = ULTRIX;
replace = "/* This file intentionally left blank. */\n";
};
/*
* sys/wait.h on AIX 3.2.5 puts the declaration of wait3 before the definition * 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) causes havoc. * of struct rusage, so the prototype (added by fixproto) causes havoc.
*/ */
...@@ -898,18 +948,13 @@ fix = { ...@@ -898,18 +948,13 @@ fix = {
}; };
/* /*
* Determine if we're on Interactive Unix 2.2 or later, in which case we * On Interactive Unix 2.2, certain traditional Unix definitions
* need to fix some additional files. This is the same test for ISC that * (notably getc and putc in stdio.h) are omitted if __STDC__ is
* Autoconf uses. On Interactive 2.2, certain traditional Unix * defined, not just if _POSIX_SOURCE is defined. This makes it
* definitions (notably getc and putc in stdio.h) are omitted if __STDC__
* is defined, not just if _POSIX_SOURCE is defined. This makes it
* impossible to compile any nontrivial program except with -posix. * impossible to compile any nontrivial program except with -posix.
*/ */
fix = { fix = {
hackname = interactv_add1; hackname = isc_omits_with_stdc;
test = " -d /etc/conf/kconfig.d";
test = ' -n "`grep _POSIX_VERSION /usr/include/sys/unistd.h`"';
files = "stdio.h"; files = "stdio.h";
files = "math.h"; files = "math.h";
...@@ -918,33 +963,12 @@ fix = { ...@@ -918,33 +963,12 @@ fix = {
files = "sys/fcntl.h"; files = "sys/fcntl.h";
files = "sys/dirent.h"; files = "sys/dirent.h";
select = "defined\(__STDC__\) && !defined\(_POSIX_SOURCE\)";
sed = "s/!defined(__STDC__) && !defined(_POSIX_SOURCE)/" sed = "s/!defined(__STDC__) && !defined(_POSIX_SOURCE)/"
"!defined(_POSIX_SOURCE)/"; "!defined(_POSIX_SOURCE)/";
}; };
fix = {
hackname = interactv_add2;
test = " -d /etc/conf/kconfig.d";
test = ' -n "`grep _POSIX_VERSION /usr/include/sys/unistd.h`"';
files = math.h;
sed = "s/fmod(double)/fmod(double, double)/";
};
fix = {
hackname = interactv_add3;
test = " -d /etc/conf/kconfig.d";
test = ' -n "`grep _POSIX_VERSION /usr/include/sys/unistd.h`"';
files = sys/limits.h;
sed = "/CHILD_MAX/s,/\\* Max, Max,";
sed = "/OPEN_MAX/s,/\\* Max, Max,";
};
/* /*
* Fix various _IO* defines, but do *not* quote the characters cgxtf. * Fix various _IO* defines, but do *not* quote the characters cgxtf.
*/ */
...@@ -1838,41 +1862,6 @@ fix = { ...@@ -1838,41 +1862,6 @@ fix = {
/* /*
* 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.
* To ensure only Sun's is fixed, we grep for a likely unique string.
* Fix also on sysV68 R3V7.1 (head/memory.h\t50.1\t )
*/
fix = {
hackname = sun_memcpy;
files = memory.h;
select = "/\\*\t@\\(#\\)"
"(head/memory.h\t50.1\t "
"|memory\\.h 1\\.[2-4] 8./../.. SMI; from S5R2 1\\.2\t)\\*/";
sed = "1i\\\n/* This file was generated by fixincludes */\\\n"
"#ifndef __memory_h__\\\n"
"#define __memory_h__\\\n\\\n"
"#ifdef __STDC__\\\n"
"extern void *memccpy();\\\n"
"extern void *memchr();\\\n"
"extern void *memcpy();\\\n"
"extern void *memset();\\\n"
"#else\\\n"
"extern char *memccpy();\\\n"
"extern char *memchr();\\\n"
"extern char *memcpy();\\\n"
"extern char *memset();\\\n"
"#endif /* __STDC__ */\\\n\\\n"
"extern int memcmp();\\\n\\\n"
"#endif /* __memory_h__ */\n";
sed = "1,$d";
};
/*
* Check for yet more missing ';' in struct (in SunOS 4.0.x) * Check for yet more missing ';' in struct (in SunOS 4.0.x)
*/ */
fix = { fix = {
...@@ -2456,18 +2445,6 @@ fix = { ...@@ -2456,18 +2445,6 @@ fix = {
/* /*
* Cancel out ansi_compat.h on Ultrix. Replace it with empty file.
*/
fix = {
hackname = ultrix_ansi_compat;
files = ansi_compat.h;
select = ULTRIX;
sed = "1i\\\n/* This file intentionally left blank. */\n";
sed = "1,$d";
};
/*
* Ultrix V4.[35] puts the declaration of uname before the definition * Ultrix V4.[35] puts the declaration of uname before the definition
* of struct utsname, so the prototype (added by fixproto) causes havoc. * of struct utsname, so the prototype (added by fixproto) causes havoc.
*/ */
...@@ -2758,7 +2735,10 @@ fix = { ...@@ -2758,7 +2735,10 @@ fix = {
*/ */
fix = { fix = {
hackname = x11_sprintf; hackname = x11_sprintf;
files = X11*/Xmu.h; files = X11/Xmu.h;
files = X11/Xmu/Xmu.h;
select = 'sprintf\(\)';
sed = "s,^extern char \\*\tsprintf();$,#ifndef __STDC__\\\n" sed = "s,^extern char \\*\tsprintf();$,#ifndef __STDC__\\\n"
"extern char *\tsprintf();\\\n" "extern char *\tsprintf();\\\n"
"#endif /* !defined __STDC__ */,"; "#endif /* !defined __STDC__ */,";
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
# 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 114 fixup scripts. # This script contains 112 fixup scripts.
# #
# See README-fixinc for more information. # See README-fixinc for more information.
# #
# fixincludes copyright (c) 1999 The Free Software Foundation, Inc. # fixincludes copyright (c) 2000 The Free Software Foundation, Inc.
# #
# fixincludes is free software. # fixincludes is free software.
# #
...@@ -659,6 +659,42 @@ _EOF_ ...@@ -659,6 +659,42 @@ _EOF_
# #
# Fix Aab_Sun_Memcpy
#
case "${file}" in ./memory.h )
if ( test -n "`egrep '/\\* @\\(#\\)(head/memory.h 50.1 |memory\\.h 1\\.[2-4] 8./../.. SMI; from S5R2 1\\.2 )\\*/' ${file}`"
) > /dev/null 2>&1 ; then
echo "AAB_sun_memcpy replacing file ${file}" >&2
cat > ${DESTFILE} << '_EOF_'
/* This file was generated by fixincludes */
#ifndef __memory_h__
#define __memory_h__
#ifdef __STDC__
extern void *memccpy();
extern void *memchr();
extern void *memcpy();
extern void *memset();
#else
extern char *memccpy();
extern char *memchr();
extern char *memcpy();
extern char *memset();
#endif /* __STDC__ */
extern int memcmp();
#endif /* __memory_h__ */
_EOF_
continue
fi # end of select 'if'
;; # case end for file name test
esac
#
# Fix Aab_Svr4_Replace_Byteorder # Fix Aab_Svr4_Replace_Byteorder
# #
case "${file}" in ./sys/byteorder.h ) case "${file}" in ./sys/byteorder.h )
...@@ -824,6 +860,24 @@ _EOF_ ...@@ -824,6 +860,24 @@ _EOF_
# #
# Fix Aab_Ultrix_Ansi_Compat
#
case "${file}" in ./ansi_compat.h )
if ( test -n "`egrep 'ULTRIX' ${file}`"
) > /dev/null 2>&1 ; then
echo "AAB_ultrix_ansi_compat replacing file ${file}" >&2
cat > ${DESTFILE} << '_EOF_'
/* This file intentionally left blank. */
_EOF_
continue
fi # end of select 'if'
;; # case end for file name test
esac
#
# Fix Aix_Syswait # Fix Aix_Syswait
# #
case "${file}" in ./sys/wait.h ) case "${file}" in ./sys/wait.h )
...@@ -1461,7 +1515,7 @@ extern "C" {\ ...@@ -1461,7 +1515,7 @@ extern "C" {\
# #
# Fix Interactv_Add1 # Fix Isc_Omits_With_Stdc
# #
case "${file}" in ./stdio.h | \ case "${file}" in ./stdio.h | \
./math.h | \ ./math.h | \
...@@ -1469,11 +1523,10 @@ extern "C" {\ ...@@ -1469,11 +1523,10 @@ extern "C" {\
./sys/limits.h | \ ./sys/limits.h | \
./sys/fcntl.h | \ ./sys/fcntl.h | \
./sys/dirent.h ) ./sys/dirent.h )
if ( test '(' -d /etc/conf/kconfig.d ')' -a \ if ( test -n "`egrep 'defined(__STDC__) && !defined(_POSIX_SOURCE)' ${file}`"
'(' -n "`grep _POSIX_VERSION /usr/include/sys/unistd.h`" ')'
) > /dev/null 2>&1 ; then ) > /dev/null 2>&1 ; then
fixlist="${fixlist} fixlist="${fixlist}
interactv_add1" isc_omits_with_stdc"
if [ ! -r ${DESTFILE} ] if [ ! -r ${DESTFILE} ]
then infile=${file} then infile=${file}
else infile=${DESTFILE} ; fi else infile=${DESTFILE} ; fi
...@@ -1482,52 +1535,7 @@ extern "C" {\ ...@@ -1482,52 +1535,7 @@ extern "C" {\
< $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 test expression 'if' fi # end of select 'if'
;; # case end for file name test
esac
#
# Fix Interactv_Add2
#
case "${file}" in ./math.h )
if ( test '(' -d /etc/conf/kconfig.d ')' -a \
'(' -n "`grep _POSIX_VERSION /usr/include/sys/unistd.h`" ')'
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
interactv_add2"
if [ ! -r ${DESTFILE} ]
then infile=${file}
else infile=${DESTFILE} ; fi
sed -e 's/fmod(double)/fmod(double, double)/' \
< $infile > ${DESTDIR}/fixinc.tmp
rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
fi # end of test expression 'if'
;; # case end for file name test
esac
#
# Fix Interactv_Add3
#
case "${file}" in ./sys/limits.h )
if ( test '(' -d /etc/conf/kconfig.d ')' -a \
'(' -n "`grep _POSIX_VERSION /usr/include/sys/unistd.h`" ')'
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
interactv_add3"
if [ ! -r ${DESTFILE} ]
then infile=${file}
else infile=${DESTFILE} ; fi
sed -e '/CHILD_MAX/s,/\* Max, Max,' \
-e '/OPEN_MAX/s,/\* Max, Max,' \
< $infile > ${DESTDIR}/fixinc.tmp
rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
fi # end of test expression 'if'
;; # case end for file name test ;; # case end for file name test
esac esac
...@@ -2617,48 +2625,6 @@ typedef __regmatch_t regmatch_t; ...@@ -2617,48 +2625,6 @@ typedef __regmatch_t regmatch_t;
# #
# Fix Sun_Memcpy
#
case "${file}" in ./memory.h )
if ( test -n "`egrep '/\\* @\\(#\\)(head/memory.h 50.1 |memory\\.h 1\\.[2-4] 8./../.. SMI; from S5R2 1\\.2 )\\*/' ${file}`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
sun_memcpy"
if [ ! -r ${DESTFILE} ]
then infile=${file}
else infile=${DESTFILE} ; fi
sed -e '1i\
/* This file was generated by fixincludes */\
#ifndef __memory_h__\
#define __memory_h__\
\
#ifdef __STDC__\
extern void *memccpy();\
extern void *memchr();\
extern void *memcpy();\
extern void *memset();\
#else\
extern char *memccpy();\
extern char *memchr();\
extern char *memcpy();\
extern char *memset();\
#endif /* __STDC__ */\
\
extern int memcmp();\
\
#endif /* __memory_h__ */
' \
-e '1,$d' \
< $infile > ${DESTDIR}/fixinc.tmp
rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
fi # end of select 'if'
;; # case end for file name test
esac
#
# Fix Sun_Rusers_Semi # Fix Sun_Rusers_Semi
# #
case "${file}" in ./rpcsvc/rusers.h ) case "${file}" in ./rpcsvc/rusers.h )
...@@ -2985,30 +2951,6 @@ extern unsigned int\ ...@@ -2985,30 +2951,6 @@ extern unsigned int\
# #
# Fix Ultrix_Ansi_Compat
#
case "${file}" in ./ansi_compat.h )
if ( test -n "`egrep 'ULTRIX' ${file}`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
ultrix_ansi_compat"
if [ ! -r ${DESTFILE} ]
then infile=${file}
else infile=${DESTFILE} ; fi
sed -e '1i\
/* This file intentionally left blank. */
' \
-e '1,$d' \
< $infile > ${DESTDIR}/fixinc.tmp
rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
fi # end of select 'if'
;; # case end for file name test
esac
#
# Fix Ultrix_Fix_Fixproto # Fix Ultrix_Fix_Fixproto
# #
case "${file}" in ./sys/utsname.h ) case "${file}" in ./sys/utsname.h )
...@@ -3454,7 +3396,10 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\ ...@@ -3454,7 +3396,10 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
# #
# Fix X11_Sprintf # Fix X11_Sprintf
# #
case "${file}" in ./X11*/Xmu.h ) case "${file}" in ./X11/Xmu.h | \
./X11/Xmu/Xmu.h )
if ( test -n "`egrep 'sprintf\\(\\)' ${file}`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist} fixlist="${fixlist}
x11_sprintf" x11_sprintf"
if [ ! -r ${DESTFILE} ] if [ ! -r ${DESTFILE} ]
...@@ -3467,6 +3412,7 @@ extern char * sprintf();\ ...@@ -3467,6 +3412,7 @@ extern char * sprintf();\
< $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 select 'if'
;; # case end for file name test ;; # case end for file name test
esac esac
# IF the output has been removed OR it is unchanged, # IF the output has been removed OR it is unchanged,
......
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