Commit 4c188026 by Bruce Korb Committed by Bruce Korb

Added definitions needed by OSR5

From-SVN: r33556
parent 0ca4f243
2000-40-30 Bruce Korb <bkorb@gnu.org>
* fixinc/inclhack.def: Added definitions needed by OSR5
* fixinc/inclhack.sh: regen
* fixinc/fixincl.x: regen
2000-04-30 Richard Henderson <rth@cygnus.com> 2000-04-30 Richard Henderson <rth@cygnus.com>
* ifcvt.c (dead_or_predicable): Manually squeeze non-movable notes * ifcvt.c (dead_or_predicable): Manually squeeze non-movable notes
......
...@@ -791,28 +791,6 @@ fix = { ...@@ -791,28 +791,6 @@ fix = {
}; };
/*
* On SCO OpenServer 5.0.0 through (at least) 5.0.5 <sys/stat.h> contains
* tiny static wrappers that aren't C++ safe.
*/
fix = {
hackname = sco5_stat_wrappers;
mach = "i*86-*-sco3.2v5*";
files = "sys/stat.h";
sed = "/^static int[ \t]*[a-z]*stat(/i\\\n"
"#ifdef __cplusplus\\\n"
"extern \"C\"\\\n"
"{\\\n"
"#endif\\\n";
sed = "/^}$/a\\\n"
"#ifdef __cplusplus\\\n"
"}\\\n"
"#endif \/* __cplusplus *\/\\\n";
};
#ifdef OLD_CPP #ifdef OLD_CPP
/* /*
* Fix else and endif directives that contain non-commentary text * Fix else and endif directives that contain non-commentary text
...@@ -904,6 +882,7 @@ fix = { ...@@ -904,6 +882,7 @@ fix = {
sed = "s/^extern struct sigevent;/struct sigevent;/"; sed = "s/^extern struct sigevent;/struct sigevent;/";
}; };
/* /*
* get rid of bogus inline definitions in HP-UX 8.0 * get rid of bogus inline definitions in HP-UX 8.0
*/ */
...@@ -1540,6 +1519,56 @@ fix = { ...@@ -1540,6 +1519,56 @@ fix = {
/* /*
* "!__STDC__" is "!defined( __STRICT_ANSI__ )"
*/
fix = {
hackname = sco_strict_ansi;
mach = "i?86-*-sco3.2*";
select = "^[ \t]*#[ \t]*if.*!__STDC__";
sed = 's/!__STDC__/!defined(__STRICT_ANSI__)/g';
};
/*
* The static functions lstat() and fchmod() in <sys/stat.h>
* cause G++ grief since they're not wrapped in "if __cplusplus".
*
* On SCO OpenServer 5.0.0 through (at least) 5.0.5 <sys/stat.h> contains
* tiny static wrappers that aren't C++ safe.
*/
fix = {
hackname = sco_static_func;
files = sys/stat.h;
mach = "i?86-*-sco3.2*";
select = "^static int";
sed = "/^static int/i\\\n"
"#if __cplusplus\\\n"
"extern \"C\" {\\\n"
"#endif /* __cplusplus */";
sed = "/^}$/a\\\n"
"#if __cplusplus\\\n"
" }\\\n"
"#endif /* __cplusplus */";
};
/*
* Fix prototype declaration of utime in sys/times.h.
* In 3.2v4.0 the const is missing.
*/
fix = {
hackname = sco_utime;
files = sys/times.h;
mach = "i?86-*-sco3.2v4*";
select = "\(const char \*, struct utimbuf \*\);";
sed = 's/(const char \*, struct utimbuf \*);/'
'(const char *, const struct utimbuf *);/';
};
/*
* Sony NEWSOS 5.0 does not support the complete ANSI C standard. * Sony NEWSOS 5.0 does not support the complete ANSI C standard.
*/ */
#ifdef SONY #ifdef SONY
...@@ -1673,6 +1702,33 @@ fix = { ...@@ -1673,6 +1702,33 @@ fix = {
}; };
#endif #endif
/*
* Apply fix this to all OSs since this problem seems to effect
* more than just SunOS.
*/
fix = {
hackname = sun_auth_proto;
files = rpc/auth.h;
files = rpc/clnt.h;
files = rpc/svc.h;
files = rpc/xdr.h;
/*
* Select those files containing '(*name)()'.
*/
select = '\(\*[a-z][a-z_]*\)\(\)';
sed = 's'
'/^\(.*(\*[a-z][a-z_]*)(\)' '\();.*\)'
"/\\\n"
"#ifdef __cplusplus\\\n"
'\1...\2' "\\\n"
"#else\\\n"
'\1\2' "\\\n"
"#endif"
"/";
};
/* /*
* Fix bogus #ifdef on SunOS 4.1. * Fix bogus #ifdef on SunOS 4.1.
*/ */
...@@ -1760,33 +1816,6 @@ fix = { ...@@ -1760,33 +1816,6 @@ fix = {
/* /*
* Apply fix this to all OSs since this problem seems to effect
* more than just SunOS. In general, fixes which are triggered
* by a specific target are bad.
*/
fix = {
hackname = sun_auth_proto;
files = rpc/auth.h;
files = rpc/clnt.h;
files = rpc/svc.h;
files = rpc/xdr.h;
/*
* Select those files containing '(*name)()'.
*/
select = '\(\*[a-z][a-z_]*\)\(\)';
sed = 's'
'/^\(.*(\*[a-z][a-z_]*)(\)' '\();.*\)'
"/\\\n"
"#ifdef __cplusplus\\\n"
'\1...\2' "\\\n"
"#else\\\n"
'\1\2' "\\\n"
"#endif"
"/";
};
/*
* math.h on SunOS 4 puts the declaration of matherr before the definition * math.h on SunOS 4 puts the declaration of matherr before the definition
* of struct exception, so the prototype (added by fixproto) causes havoc. * of struct exception, so the prototype (added by fixproto) causes havoc.
*/ */
...@@ -1943,16 +1972,16 @@ fix = { ...@@ -1943,16 +1972,16 @@ fix = {
/* /*
* Fix broken decl of getcwd present on some svr4 systems. * Fix broken decl of getcwd present on some svr4 systems.
*/ */
#ifdef SVR4
fix = { fix = {
hackname = svr4_getcwd; hackname = svr4_getcwd;
files = stdlib.h; files = stdlib.h;
files = unistd.h; files = unistd.h;
files = prototypes.h;
select = 'getcwd\(char \*, int\)'; select = 'getcwd\(char \*, int\)';
sed = 's/getcwd(char \*, int)/getcwd(char *, size_t)/'; sed = 's/getcwd(char \*, int)/getcwd(char *, size_t)/';
}; };
#endif
/* /*
* set ifdef _KERNEL * set ifdef _KERNEL
...@@ -2034,10 +2063,10 @@ fix = { ...@@ -2034,10 +2063,10 @@ fix = {
}; };
#endif #endif
/* /*
* Fix broken decl of profil present on some svr4 systems. * Fix broken decl of profil present on some svr4 systems.
*/ */
#ifdef SVR4
fix = { fix = {
hackname = svr4_profil; hackname = svr4_profil;
files = stdlib.h; files = stdlib.h;
...@@ -2047,7 +2076,7 @@ fix = { ...@@ -2047,7 +2076,7 @@ fix = {
'unsigned int, unsigned int)' 'unsigned int, unsigned int)'
'/profil(unsigned short *, size_t, int, unsigned)/'; '/profil(unsigned short *, size_t, int, unsigned)/';
}; };
#endif
/* /*
* Convert functions to prototype form, and fix arg names in <sys/stat.h>. * Convert functions to prototype form, and fix arg names in <sys/stat.h>.
...@@ -2143,7 +2172,9 @@ fix = { ...@@ -2143,7 +2172,9 @@ fix = {
}; };
#endif /* SVR5 */ #endif /* SVR5 */
/* Fix these files to use the same types that we think they should.
/*
* Fix these files to use the same types that we think they should.
* XXX - extremely dubious changes here. * XXX - extremely dubious changes here.
*/ */
fix = { fix = {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,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.
# #
# This script contains 113 fixup scripts. # This script contains 117 fixup scripts.
# #
# See README-fixinc for more information. # See README-fixinc for more information.
# #
...@@ -1283,37 +1283,6 @@ struct rusage; ...@@ -1283,37 +1283,6 @@ struct rusage;
# #
# Fix Sco5_Stat_Wrappers
#
case "${file}" in ./sys/stat.h )
case "$target_canonical" in i*86-*-sco3.2v5* )
fixlist="${fixlist}
sco5_stat_wrappers"
if [ ! -r ${DESTFILE} ]
then infile=${file}
else infile=${DESTFILE} ; fi
sed -e '/^static int[ ]*[a-z]*stat(/i\
#ifdef __cplusplus\
extern "C"\
{\
#endif\
' \
-e '/^}$/a\
#ifdef __cplusplus\
}\
#endif /* __cplusplus */\
' \
< $infile > ${DESTDIR}/fixinc.tmp
rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
;; # case end for machine type test
esac
;; # case end for file name test
esac
#
# Fix Hp_Inline # Fix Hp_Inline
# #
case "${file}" in ./sys/spinlock.h ) case "${file}" in ./sys/spinlock.h )
...@@ -2426,6 +2395,82 @@ typedef __regmatch_t regmatch_t; ...@@ -2426,6 +2395,82 @@ typedef __regmatch_t regmatch_t;
# #
# Fix Sco_Strict_Ansi
#
case "$target_canonical" in i?86-*-sco3.2* )
if ( test -n "`egrep '^[ ]*#[ ]*if.*!__STDC__' ${file}`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
sco_strict_ansi"
if [ ! -r ${DESTFILE} ]
then infile=${file}
else infile=${DESTFILE} ; fi
sed -e 's/!__STDC__/!defined(__STRICT_ANSI__)/g' \
< $infile > ${DESTDIR}/fixinc.tmp
rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
fi # end of select 'if'
;; # case end for machine type test
esac
#
# Fix Sco_Static_Func
#
case "${file}" in ./sys/stat.h )
case "$target_canonical" in i?86-*-sco3.2* )
if ( test -n "`egrep '^static int' ${file}`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
sco_static_func"
if [ ! -r ${DESTFILE} ]
then infile=${file}
else infile=${DESTFILE} ; fi
sed -e '/^static int/i\
#if __cplusplus\
extern "C" {\
#endif /* __cplusplus */' \
-e '/^}$/a\
#if __cplusplus\
}\
#endif /* __cplusplus */' \
< $infile > ${DESTDIR}/fixinc.tmp
rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
fi # end of select 'if'
;; # case end for machine type test
esac
;; # case end for file name test
esac
#
# Fix Sco_Utime
#
case "${file}" in ./sys/times.h )
case "$target_canonical" in i?86-*-sco3.2v4* )
if ( test -n "`egrep '(const char *, struct utimbuf *);' ${file}`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
sco_utime"
if [ ! -r ${DESTFILE} ]
then infile=${file}
else infile=${DESTFILE} ; fi
sed -e 's/(const char \*, struct utimbuf \*);/(const char *, const struct utimbuf *);/' \
< $infile > ${DESTDIR}/fixinc.tmp
rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
fi # end of select 'if'
;; # case end for machine type test
esac
;; # case end for file name test
esac
#
# Fix Sony_Include # Fix Sony_Include
# #
case "${file}" in ./machine/machparam.h ) case "${file}" in ./machine/machparam.h )
...@@ -2523,6 +2568,35 @@ s@_Va_LIST@_VA_LIST@' \ ...@@ -2523,6 +2568,35 @@ s@_Va_LIST@_VA_LIST@' \
# #
# Fix Sun_Auth_Proto
#
case "${file}" in ./rpc/auth.h | \
./rpc/clnt.h | \
./rpc/svc.h | \
./rpc/xdr.h )
if ( test -n "`egrep '\\(\\*[a-z][a-z_]*\\)\\(\\)' ${file}`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
sun_auth_proto"
if [ ! -r ${DESTFILE} ]
then infile=${file}
else infile=${DESTFILE} ; fi
sed -e 's/^\(.*(\*[a-z][a-z_]*)(\)\();.*\)/\
#ifdef __cplusplus\
\1...\2\
#else\
\1\2\
#endif/' \
< $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_Bogus_Ifdef # Fix Sun_Bogus_Ifdef
# #
case "${file}" in ./hsfs/hsfs_spec.h | \ case "${file}" in ./hsfs/hsfs_spec.h | \
...@@ -2665,71 +2739,65 @@ void (*signal(...))(...);\ ...@@ -2665,71 +2739,65 @@ void (*signal(...))(...);\
# #
# Fix Sun_Auth_Proto # Fix Sunos_Matherr_Decl
# #
case "${file}" in ./rpc/auth.h | \ case "${file}" in ./math.h )
./rpc/clnt.h | \ if ( test -z "`egrep 'matherr.*struct exception' ${file}`"
./rpc/svc.h | \
./rpc/xdr.h )
if ( test -n "`egrep '\\(\\*[a-z][a-z_]*\\)\\(\\)' ${file}`"
) > /dev/null 2>&1 ; then ) > /dev/null 2>&1 ; then
fixlist="${fixlist} fixlist="${fixlist}
sun_auth_proto" sunos_matherr_decl"
if [ ! -r ${DESTFILE} ] if [ ! -r ${DESTFILE} ]
then infile=${file} then infile=${file}
else infile=${DESTFILE} ; fi else infile=${DESTFILE} ; fi
sed -e 's/^\(.*(\*[a-z][a-z_]*)(\)\();.*\)/\ sed -e '/^struct exception/,$b' \
#ifdef __cplusplus\ -e '/matherr/i\
\1...\2\ struct exception;
#else\ ' \
\1\2\
#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}
fi # end of select 'if' fi # end of bypass 'if'
;; # case end for file name test ;; # case end for file name test
esac esac
# #
# Fix Sunos_Matherr_Decl # Fix Sunos_Strlen
# #
case "${file}" in ./math.h ) case "${file}" in ./strings.h )
if ( test -z "`egrep 'matherr.*struct exception' ${file}`" if ( test -n "`egrep 'int[ ]*strlen' ${file}`"
) > /dev/null 2>&1 ; then ) > /dev/null 2>&1 ; then
fixlist="${fixlist} fixlist="${fixlist}
sunos_matherr_decl" sunos_strlen"
if [ ! -r ${DESTFILE} ] if [ ! -r ${DESTFILE} ]
then infile=${file} then infile=${file}
else infile=${DESTFILE} ; fi else infile=${DESTFILE} ; fi
sed -e '/^struct exception/,$b' \ sed -e 's/int[ ]*strlen();/__SIZE_TYPE__ strlen();/' \
-e '/matherr/i\
struct exception;
' \
< $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'
;; # case end for file name test ;; # case end for file name test
esac esac
# #
# Fix Sunos_Strlen # Fix Svr4_Getcwd
# #
case "${file}" in ./strings.h ) case "${file}" in ./stdlib.h | \
if ( test -n "`egrep 'int[ ]*strlen' ${file}`" ./unistd.h | \
./prototypes.h )
if ( test -n "`egrep 'getcwd\\(char \\*, int\\)' ${file}`"
) > /dev/null 2>&1 ; then ) > /dev/null 2>&1 ; then
fixlist="${fixlist} fixlist="${fixlist}
sunos_strlen" svr4_getcwd"
if [ ! -r ${DESTFILE} ] if [ ! -r ${DESTFILE} ]
then infile=${file} then infile=${file}
else infile=${DESTFILE} ; fi else infile=${DESTFILE} ; fi
sed -e 's/int[ ]*strlen();/__SIZE_TYPE__ strlen();/' \ sed -e 's/getcwd(char \*, int)/getcwd(char *, size_t)/' \
< $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}
...@@ -2739,6 +2807,25 @@ struct exception; ...@@ -2739,6 +2807,25 @@ struct exception;
# #
# Fix Svr4_Profil
#
case "${file}" in ./stdlib.h | \
./unistd.h )
fixlist="${fixlist}
svr4_profil"
if [ ! -r ${DESTFILE} ]
then infile=${file}
else infile=${DESTFILE} ; fi
sed -e 's/profil(unsigned short \*, unsigned int, unsigned int, unsigned int)/profil(unsigned short *, size_t, int, unsigned)/' \
< $infile > ${DESTDIR}/fixinc.tmp
rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
;; # case end for file name test
esac
#
# Fix Systypes # Fix Systypes
# #
case "${file}" in ./sys/types.h | \ case "${file}" in ./sys/types.h | \
......
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