Commit c16b55aa by Bruce Korb

Added exclusion of C++ files for double slash fix

From-SVN: r20117
parent 8a5b8e20
/*
* $Id: fixincl.c,v 1.1 1998/03/20 16:19:41 korbb Exp $
* $Id: fixincl.c,v 1.4 1998/08/05 10:20:11 korbb Exp $
*
* Install modified versions of certain ANSI-incompatible system header
* files which are fixed to work correctly with ANSI C and placed in a
......@@ -28,7 +28,6 @@
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/stropts.h>
#include <sys/wait.h>
#include <signal.h>
#include <stdio.h>
......@@ -36,8 +35,6 @@
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <stropts.h>
#include <poll.h>
#include <fcntl.h>
#include <ctype.h>
......@@ -138,7 +135,7 @@ main (argc, argv)
if (strcmp (argv[1], "-v") == 0)
{
fputs ("$Id: fixincl.c,v 1.1 1998/03/20 16:19:41 korbb Exp $\n", stderr);
fputs ("$Id: fixincl.c,v 1.3 1998/06/02 07:00:12 korbb Exp $\n", stderr);
exit (EXIT_SUCCESS);
}
......@@ -448,17 +445,18 @@ createFile (pzFile)
}
tSuccess
testTest (pTest)
testTest (pTest, pzFile)
tTestDesc *pTest;
char* pzFile;
{
char *pzRes;
tSuccess res = FAILURE;
static char zCmdBuf[4096];
tSCC zCmdFmt[] = "if ( test %s ) > /dev/null 2>&1\n"
tSCC zCmdFmt[] = "f=%s\nif ( test %s ) > /dev/null 2>&1\n"
"then echo TRUE\n" "else echo FALSE\n" "fi";
sprintf (zCmdBuf, zCmdFmt, pTest->pzTest);
sprintf (zCmdBuf, zCmdFmt, pzFile, pTest->pzTest);
pzRes = runShell (zCmdBuf);
if (*pzRes == 'T')
res = SUCCESS;
......@@ -643,7 +641,7 @@ process (pzDta, pzDir, pzFile)
* IF *any* of the shell tests fail,
* THEN do not process the fix.
*/
if (!SUCCESSFUL (testTest (pTD)))
if (!SUCCESSFUL (testTest (pTD, pzFile)))
goto nextFix;
break;
......
......@@ -2,7 +2,7 @@
#
# DO NOT EDIT THIS FILE (fixincl.sh)
#
# It has been autogen-ed Thursday March 19, 1998 at 08:37:00 AM PST
# It has been autogen-ed Thursday May 28, 1998 at 08:21:16 AM PDT
# From the definitions inclhack.def
# and the template file inclhack.tpl
#
......@@ -14,19 +14,19 @@
#
# See README-fixinc for more information.
#
# inclhack is free software.
# fixincludes is free software.
#
# You may 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.
#
# inclhack is distributed in the hope that it will be useful,
# fixincludes 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 inclhack. See the file "COPYING". If not,
# along with fixincludes. See the file "COPYING". If not,
# write to: The Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
......@@ -80,6 +80,7 @@ if test -z "${target_canonical}" ; then
target_canonical="`config.guess`" ; fi
test -z "${target_canonical}" && target_canonical=unknown
fi
export target_canonical
# # # # # # # # # # # # # # # # # # # # #
#
......@@ -108,7 +109,7 @@ case $LIB in
;;
esac
echo Building fixed headers in ${LIB}
echo Fixing headers into ${LIB} for ${target_canonical} target
# Determine whether this system has symbolic links.
if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
......
/*
* DO NOT EDIT THIS FILE (fixincl.x)
*
* It has been autogen-ed Thursday March 19, 1998 at 08:34:20 AM PST
* It has been autogen-ed Thursday May 28, 1998 at 08:21:12 AM PDT
* From the definitions inclhack.def
* and the template file fixincl.tpl
*
......@@ -56,7 +56,7 @@ tTestDesc aAix_SyswaitTests[] = {
*/
const char* apzAix_SyswaitPatch[] = { "sed",
"-e" "/^extern pid_t wait3();$/i\\\n"
"struct rusage;",
"struct rusage;\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -275,13 +275,13 @@ tSCC zAvoid_BoolList[] =
*/
const char* apzAvoid_BoolPatch[] = { "sed",
"-e" "/^#[ \t]*define[ \t][ \t]*bool[ \t][ \t]*char[ \t]*$/i\\\n"
"#ifndef __cplusplus",
"#ifndef __cplusplus\n",
"-e" "/^#[ \t]*define[ \t][ \t]*bool[ \t][ \t]*char[ \t]*$/a\\\n"
"#endif",
"#endif\n",
"-e" "/^typedef[ \t][ \t]*char[ \t][ \t]*bool[ \t]*;/i\\\n"
"#ifndef __cplusplus",
"#ifndef __cplusplus\n",
"-e" "/^typedef[ \t][ \t]*char[ \t][ \t]*bool[ \t]*;/a\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -314,11 +314,11 @@ const char* apzBad_Malloc_DeclPatch[] = { "sed",
"#ifdef __cplusplus\\\n"
"extern \"C\" {\\\n"
"#endif\\\n"
"",
"\n",
"-e" "$a\\\n"
"#ifdef __cplusplus\\\n"
"}\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -405,7 +405,7 @@ tTestDesc aBroken_Assert_StdioTests[] = {
*/
const char* apzBroken_Assert_StdioPatch[] = { "sed",
"-e" "1i\\\n"
"#include <stdio.h>",
"#include <stdio.h>\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -444,7 +444,7 @@ const char* apzBroken_Assert_StdlibPatch[] = { "sed",
"-e" "1i\\\n"
"#ifdef __cplusplus\\\n"
"#include <stdlib.h>\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -766,11 +766,11 @@ const char* apzHpux_Cxx_UnreadyPatch[] = { "sed",
"#ifdef __cplusplus\\\n"
"extern \"C\" {\\\n"
"#endif\\\n"
"",
"\n",
"-e" "$a\\\n"
"#ifdef __cplusplus\\\n"
"}\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -792,9 +792,9 @@ tSCC zHpux_MaxintList[] =
*/
const char* apzHpux_MaxintPatch[] = { "sed",
"-e" "/^#[ \t]*define[ \t]*MAXINT[ \t]/i\\\n"
"#ifndef MAXINT",
"#ifndef MAXINT\n",
"-e" "/^#[ \t]*define[ \t]*MAXINT[ \t]/a\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -1082,7 +1082,7 @@ tTestDesc aIrix_SockaddrTests[] = {
*/
const char* apzIrix_SockaddrPatch[] = { "sed",
"-e" "/authdes_create.*struct sockaddr/i\\\n"
"struct sockaddr;",
"struct sockaddr;\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -1104,7 +1104,7 @@ tSCC zIrix_Struct__FileList[] =
*/
const char* apzIrix_Struct__FilePatch[] = { "sed",
"-e" "/xdrstdio_create.*struct __file_s/i\\\n"
"struct __file_s;",
"struct __file_s;\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -1239,29 +1239,29 @@ tTestDesc aLimits_IfndefsTests[] = {
*/
const char* apzLimits_IfndefsPatch[] = { "sed",
"-e" "/[ \t]FLT_MIN[ \t]/i\\\n"
"#ifndef FLT_MIN",
"#ifndef FLT_MIN\n",
"-e" "/[ \t]FLT_MIN[ \t]/a\\\n"
"#endif",
"#endif\n",
"-e" "/[ \t]FLT_MAX[ \t]/i\\\n"
"#ifndef FLT_MAX",
"#ifndef FLT_MAX\n",
"-e" "/[ \t]FLT_MAX[ \t]/a\\\n"
"#endif",
"#endif\n",
"-e" "/[ \t]FLT_DIG[ \t]/i\\\n"
"#ifndef FLT_DIG",
"#ifndef FLT_DIG\n",
"-e" "/[ \t]FLT_DIG[ \t]/a\\\n"
"#endif",
"#endif\n",
"-e" "/[ \t]DBL_MIN[ \t]/i\\\n"
"#ifndef DBL_MIN",
"#ifndef DBL_MIN\n",
"-e" "/[ \t]DBL_MIN[ \t]/a\\\n"
"#endif",
"#endif\n",
"-e" "/[ \t]DBL_MAX[ \t]/i\\\n"
"#ifndef DBL_MAX",
"#ifndef DBL_MAX\n",
"-e" "/[ \t]DBL_MAX[ \t]/a\\\n"
"#endif",
"#endif\n",
"-e" "/[ \t]DBL_DIG[ \t]/i\\\n"
"#ifndef DBL_DIG",
"#ifndef DBL_DIG\n",
"-e" "/[ \t]DBL_DIG[ \t]/a\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -1345,7 +1345,7 @@ const char* apzM88k_Bad_Hypot_OptPatch[] = { "sed",
"{\\\n"
"\treturn fabs (hypot (x, y));\\\n"
"}\\\n"
"#define hypot\tfake_hypot",
"#define hypot\tfake_hypot\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -1506,19 +1506,19 @@ const char* apzMath_ExceptionPatch[] = { "sed",
"-e" "/struct exception/i\\\n"
"#ifdef __cplusplus\\\n"
"#define exception __math_exception\\\n"
"#endif",
"#endif\n",
"-e" "/struct exception/a\\\n"
"#ifdef __cplusplus\\\n"
"#undef exception\\\n"
"#endif",
"#endif\n",
"-e" "/matherr/i\\\n"
"#ifdef __cplusplus\\\n"
"#define exception __math_exception\\\n"
"#endif",
"#endif\n",
"-e" "/matherr/a\\\n"
"#ifdef __cplusplus\\\n"
"#undef exception\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -1599,7 +1599,7 @@ const char* apzMotorola_Stupid_OptPatch[] = { "sed",
"{\\\n"
"\treturn fabs (hypot (x, y));\\\n"
"}\\\n"
"#define hypot\tfake_hypot",
"#define hypot\tfake_hypot\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -1650,9 +1650,9 @@ tTestDesc aNews_Os_RecursionTests[] = {
*/
const char* apzNews_Os_RecursionPatch[] = { "sed",
"-e" "/^#include <stdlib.h>/i\\\n"
"#ifdef BOGUS_RECURSION",
"#ifdef BOGUS_RECURSION\n",
"-e" "/^#include <stdlib.h>/a\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -1794,8 +1794,15 @@ tSCC zNo_Double_SlashName[] =
tSCC zNo_Double_SlashSelect0[] =
"//[^*]";
#define NO_DOUBLE_SLASH_TEST_CT 1
/*
* content test pattern. A shell will deal with it later.
*/
tSCC zNo_Double_SlashTest0[] =
"-z \"`echo ${f}|grep ++`\"";
#define NO_DOUBLE_SLASH_TEST_CT 2
tTestDesc aNo_Double_SlashTests[] = {
{ TT_TEST, zNo_Double_SlashTest0, 0 /* unused */ },
{ TT_EGREP, zNo_Double_SlashSelect0, (regex_t*)NULL } };
/*
......@@ -1887,7 +1894,7 @@ const char* apzOsf_Namespace_BPatch[] = { "sed",
"-e" "/#include <reg_types.h>/a\\\n"
"typedef __regex_t\tregex_t;\\\n"
"typedef __regoff_t\tregoff_t;\\\n"
"typedef __regmatch_t\tregmatch_t;",
"typedef __regmatch_t\tregmatch_t;\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -1946,9 +1953,9 @@ tTestDesc aRs6000_DoubleTests[] = {
*/
const char* apzRs6000_DoublePatch[] = { "sed",
"-e" "/class[(]/i\\\n"
"#ifndef __cplusplus",
"#ifndef __cplusplus\n",
"-e" "/class[(]/a\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -2186,9 +2193,9 @@ const char* apzSun_CatmacroPatch[] = { "sed",
"-e" "/^#define[ \t]CAT(a,b)/ i\\\n"
"#ifdef __STDC__ \\\n"
"#define CAT(a,b) a##b\\\n"
"#else",
"#else\n",
"-e" "/^#define[ \t]CAT(a,b)/ a\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -2260,7 +2267,7 @@ const char* apzSun_MemcpyPatch[] = { "sed",
"\\\n"
"extern int memcmp();\\\n"
"\\\n"
"#endif /* __memory_h__ */",
"#endif /* __memory_h__ */\n",
"-e" "1,$d",
(char*)NULL };
......@@ -2323,9 +2330,9 @@ const char* apzSun_SignalPatch[] = { "sed",
"-e" "/^void\t(\\*signal())();$/i\\\n"
"#ifdef __cplusplus\\\n"
"void\t(*signal(...))(...);\\\n"
"#else",
"#else\n",
"-e" "/^void\t(\\*signal())();$/a\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -2404,7 +2411,7 @@ tTestDesc aSunos_Matherr_DeclTests[] = {
*/
const char* apzSunos_Matherr_DeclPatch[] = { "sed",
"-e" "/matherr/i\\\n"
"struct exception;",
"struct exception;\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -2469,20 +2476,20 @@ const char* apzSystypesPatch[] = { "sed",
"-e" "/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]size_t/i\\\n"
"#ifndef __SIZE_TYPE__\\\n"
"#define __SIZE_TYPE__ long unsigned int\\\n"
"#endif",
"#endif\n",
"-e" "s/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]size_t/typedef __SIZE_TYPE__ size_t/",
"-e" "/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]ptrdiff_t/i\\\n"
"#ifndef __PTRDIFF_TYPE__\\\n"
"#define __PTRDIFF_TYPE__ long int\\\n"
"#endif",
"#endif\n",
"-e" "s/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]ptrdiff_t/typedef __PTRDIFF_TYPE__ ptrdiff_t/",
"-e" "/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",
"#ifndef __cplusplus\n",
"-e" "/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]wchar_t/a\\\n"
"#endif",
"#endif\n",
"-e" "s/typedef[ \t][ \t]*[a-z_][ \ta-z_]*[ \t]wchar_t/typedef __WCHAR_TYPE__ wchar_t/",
(char*)NULL };
......@@ -2514,9 +2521,9 @@ tTestDesc aSystypes_For_AixTests[] = {
const char* apzSystypes_For_AixPatch[] = { "sed",
"-e" "/typedef[ \t][ \t]*[A-Za-z_][ \tA-Za-z_]*[ \t]size_t/i\\\n"
"#ifndef _GCC_SIZE_T\\\n"
"#define _GCC_SIZE_T",
"#define _GCC_SIZE_T\n",
"-e" "/typedef[ \t][ \t]*[A-Za-z_][ \tA-Za-z_]*[ \t]size_t/a\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -2576,9 +2583,9 @@ const char* apzSysz_Stdlib_For_SunPatch[] = { "sed",
"-e" "s/int[ \t][ \t]*exit/void\texit/g",
"-e" "/typedef[ \ta-zA-Z_]*[ \t]size_t[ \t]*;/i\\\n"
"#ifndef _GCC_SIZE_T\\\n"
"#define _GCC_SIZE_T",
"#define _GCC_SIZE_T\n",
"-e" "/typedef[ \ta-zA-Z_]*[ \t]size_t[ \t]*;/a\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -2601,19 +2608,19 @@ tSCC zSysz_Stdtypes_For_SunList[] =
const char* apzSysz_Stdtypes_For_SunPatch[] = { "sed",
"-e" "/[\t ]size_t.*;/i\\\n"
"#ifndef _GCC_SIZE_T\\\n"
"#define _GCC_SIZE_T",
"#define _GCC_SIZE_T\n",
"-e" "/[\t ]size_t.*;/a\\\n"
"#endif",
"#endif\n",
"-e" "/[\t ]ptrdiff_t.*;/i\\\n"
"#ifndef _GCC_PTRDIFF_T\\\n"
"#define _GCC_PTRDIFF_T",
"#define _GCC_PTRDIFF_T\n",
"-e" "/[\t ]ptrdiff_t.*;/a\\\n"
"#endif",
"#endif\n",
"-e" "/[\t ]wchar_t.*;/i\\\n"
"#ifndef _GCC_WCHAR_T\\\n"
"#define _GCC_WCHAR_T",
"#define _GCC_WCHAR_T\n",
"-e" "/[\t ]wchar_t.*;/a\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -2664,7 +2671,7 @@ tTestDesc aUltrix_Ansi_CompatTests[] = {
*/
const char* apzUltrix_Ansi_CompatPatch[] = { "sed",
"-e" "1i\\\n"
"/* This file intentionally left blank. */",
"/* This file intentionally left blank. */\n",
"-e" "1,$d",
(char*)NULL };
......@@ -2836,7 +2843,7 @@ tTestDesc aUndefine_NullTests[] = {
*/
const char* apzUndefine_NullPatch[] = { "sed",
"-e" "/^#[ \t]*define[ \t][ \t]*NULL[ \t]/i\\\n"
"#undef NULL",
"#undef NULL\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -2939,19 +2946,19 @@ const char* apzVxworks_Gcc_ProblemPatch[] = { "sed",
"-e" "s/#ifdef __GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__/#if 1/",
"-e" "/[ \t]size_t/i\\\n"
"#ifndef _GCC_SIZE_T\\\n"
"#define _GCC_SIZE_T",
"#define _GCC_SIZE_T\n",
"-e" "/[ \t]size_t/a\\\n"
"#endif",
"#endif\n",
"-e" "/[ \t]ptrdiff_t/i\\\n"
"#ifndef _GCC_PTRDIFF_T\\\n"
"#define _GCC_PTRDIFF_T",
"#define _GCC_PTRDIFF_T\n",
"-e" "/[ \t]ptrdiff_t/a\\\n"
"#endif",
"#endif\n",
"-e" "/[ \t]wchar_t/i\\\n"
"#ifndef _GCC_WCHAR_T\\\n"
"#define _GCC_WCHAR_T",
"#define _GCC_WCHAR_T\n",
"-e" "/[ \t]wchar_t/a\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -3023,7 +3030,7 @@ tTestDesc aVxworks_Needs_VxworksTests[] = {
*/
const char* apzVxworks_Needs_VxworksPatch[] = { "sed",
"-e" "/#[ \t]define[ \t][ \t]*__INCstath/a\\\n"
"#include <types/vxTypesOld.h>",
"#include <types/vxTypesOld.h>\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -3067,7 +3074,7 @@ const char* apzVxworks_TimePatch[] = { "sed",
"typedef void (*__gcc_VOIDFUNCPTR) ();\\\n"
"#endif\\\n"
"#define __gcc_VOIDFUNCPTR_defined\\\n"
"#endif",
"#endif\n",
"-e" "s/VOIDFUNCPTR/__gcc_VOIDFUNCPTR/g",
(char*)NULL };
......@@ -3100,9 +3107,9 @@ const char* apzX11_ClassPatch[] = { "sed",
"-e" "/char [*]class;/i\\\n"
"#ifdef __cplusplus\\\n"
"\tchar *c_class;\\\n"
"#else",
"#else\n",
"-e" "/char [*]class;/a\\\n"
"#endif",
"#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -3163,9 +3170,9 @@ const char* apzX11_NewPatch[] = { "sed",
"-e" "/Widget\told, new;/i\\\n"
"#ifdef __cplusplus\\\n"
"\tWidget\told, c_new;\\\n"
"#else",
"#else\n",
"-e" "/Widget\told, new;/a\\\n"
"#endif",
"#endif\n",
"-e" "s/Widget new,/Widget c_new,/g",
(char*)NULL };
......
/* -*- Mode: C -*- $Id: inclhack.def,v 1.1 1998/03/20 16:19:41 korbb Exp $ */
/* -*- Mode: C -*- $Id: inclhack.def,v 1.6 1998/09/22 07:22:00 korbb Exp $ */
autogen definitions inclhack;
......@@ -991,9 +991,12 @@ fix = {
/*
* Remove the double-slash comments
* They *must* be removed so it will not create nested comments!!
* However, they will *not* be removed if '++' is in any part of
* their file name.
*/
fix = {
hackname = no_double_slash;
test = '-z "`echo ${f}|grep ++`"';
select = '//[^*]';
sed = '/\/\/[^*]/' "s|//\\(.*\\)$|/* \\1 */|";
};
......
......@@ -2,7 +2,7 @@
#
# DO NOT EDIT THIS FILE (inclhack.sh)
#
# It has been autogen-ed Thursday March 19, 1998 at 08:26:10 AM PST
# It has been autogen-ed Thursday May 28, 1998 at 08:21:14 AM PDT
# From the definitions inclhack.def
# and the template file inclhack.tpl
#
......@@ -14,19 +14,19 @@
#
# See README-fixinc for more information.
#
# inclhack is free software.
# fixincludes is free software.
#
# You may 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.
#
# inclhack is distributed in the hope that it will be useful,
# fixincludes 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 inclhack. See the file "COPYING". If not,
# along with fixincludes. See the file "COPYING". If not,
# write to: The Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
......@@ -80,6 +80,7 @@ if test -z "${target_canonical}" ; then
target_canonical="`config.guess`" ; fi
test -z "${target_canonical}" && target_canonical=unknown
fi
export target_canonical
# # # # # # # # # # # # # # # # # # # # #
#
......@@ -106,7 +107,7 @@ case $LIB in
;;
esac
echo Building fixed headers in ${LIB}
echo Fixing headers into ${LIB} for ${target_canonical} target
# Determine whether this system has symbolic links.
if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
......@@ -322,7 +323,8 @@ while [ $# != 0 ]; do
fixlist=""
# Aix_Syswait fix
#
# Fix 1: Aix_Syswait
#
case "$file" in ./sys/wait.h )
if ( test -n "`egrep 'bos325,' $file`"
......@@ -330,22 +332,22 @@ while [ $# != 0 ]; do
fixlist="${fixlist}
aix_syswait"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/^extern pid_t wait3();$/i\
struct rusage;
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Aix_Volatile fix
#
# Fix 2: Aix_Volatile
#
case "$file" in ./sys/signal.h )
if ( test -n "`egrep 'typedef volatile int sig_atomic_t' $file`"
......@@ -353,20 +355,20 @@ struct rusage;
fixlist="${fixlist}
aix_volatile"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/typedef volatile int sig_atomic_t/typedef int sig_atomic_t/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/typedef volatile int sig_atomic_t/typedef int sig_atomic_t/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Alpha_Getopt fix
#
# Fix 3: Alpha_Getopt
#
case "$file" in ./stdio.h | \
./stdlib.h )
......@@ -375,20 +377,20 @@ struct rusage;
fixlist="${fixlist}
alpha_getopt"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/getopt(int, char \*\[\],[ ]*char \*)/getopt(int, char *const[], const char *)/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/getopt(int, char \*\[\],[ ]*char \*)/getopt(int, char *const[], const char *)/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Alpha_Parens fix
#
# Fix 4: Alpha_Parens
#
case "$file" in ./sym.h )
if ( test -n "`egrep '#ifndef\\(__mips64\\)' $file`"
......@@ -396,20 +398,20 @@ struct rusage;
fixlist="${fixlist}
alpha_parens"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/#ifndef(__mips64)/#ifndef __mips64/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/#ifndef(__mips64)/#ifndef __mips64/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Alpha_Sbrk fix
#
# Fix 5: Alpha_Sbrk
#
case "$file" in ./unistd.h )
if ( test -n "`egrep 'char[ ]*\\*[ ]*sbrk[ ]*\\(' $file`"
......@@ -417,38 +419,38 @@ struct rusage;
fixlist="${fixlist}
alpha_sbrk"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/char\([ ]*\*[ ]*sbrk[ ]*(\)/void\1/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/char\([ ]*\*[ ]*sbrk[ ]*(\)/void\1/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Arm_Norcroft_Hint fix
#
# Fix 6: Arm_Norcroft_Hint
#
case "$file" in ./X11/Intrinsic.h )
fixlist="${fixlist}
arm_norcroft_hint"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/___type p_type/p_type/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/___type p_type/p_type/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Arm_Wchar fix
#
# Fix 7: Arm_Wchar
#
case "$file" in ./stdlib.h )
if ( test -n "`egrep '#[ ]*define[ ]*__wchar_t' $file`"
......@@ -456,21 +458,21 @@ struct rusage;
fixlist="${fixlist}
arm_wchar"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/\(#[ ]*ifndef[ ]*\)__wchar_t/\1_GCC_WCHAR_T/' \
-e 's/\(#[ ]*define[ ]*\)__wchar_t/\1_GCC_WCHAR_T/' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's/\(#[ ]*define[ ]*\)__wchar_t/\1_GCC_WCHAR_T/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Aux_Asm fix
#
# Fix 8: Aux_Asm
#
case "$file" in ./sys/param.h )
if ( test -n "`egrep '#ifndef NOINLINE' $file`"
......@@ -478,29 +480,27 @@ struct rusage;
fixlist="${fixlist}
aux_asm"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's|#ifndef NOINLINE|#if !defined(NOINLINE) \&\& !defined(__GNUC__)|' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's|#ifndef NOINLINE|#if !defined(NOINLINE) \&\& !defined(__GNUC__)|' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Avoid_Bool fix
#
# Fix 9: Avoid_Bool
#
case "$file" in ./curses.h )
fixlist="${fixlist}
avoid_bool"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/^#[ ]*define[ ][ ]*bool[ ][ ]*char[ ]*$/i\
#ifndef __cplusplus
......@@ -513,14 +513,16 @@ struct rusage;
' \
-e '/^typedef[ ][ ]*char[ ][ ]*bool[ ]*;/a\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Bad_Malloc_Decl fix
#
# Fix 10: Bad_Malloc_Decl
#
case "$file" in ./rpc/types.h )
if ( test -z "`egrep '\"C\"' $file`"
......@@ -528,10 +530,8 @@ struct rusage;
fixlist="${fixlist}
bad_malloc_decl"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '1i\
#ifdef __cplusplus\
......@@ -543,15 +543,17 @@ extern "C" {\
#ifdef __cplusplus\
}\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Bad_Struct_Term fix
#
# Fix 11: Bad_Struct_Term
#
case "$file" in ./curses.h )
if ( test -n "`egrep '^[ ]*typedef[ ]+struct[ ]+term[ ]*;' $file`"
......@@ -559,38 +561,38 @@ extern "C" {\
fixlist="${fixlist}
bad_struct_term"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/^[ ]*typedef[ ][ ]*\(struct[ ][ ]*term[ ]*;[ ]*\)$/\1/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/^[ ]*typedef[ ][ ]*\(struct[ ][ ]*term[ ]*;[ ]*\)$/\1/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Badquote fix
#
# Fix 12: Badquote
#
case "$file" in ./sundev/vuid_event.h )
fixlist="${fixlist}
badquote"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/doesn'\''t/does not/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/doesn'\''t/does not/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Broken_Assert_Stdio fix
#
# Fix 13: Broken_Assert_Stdio
#
case "$file" in ./assert.h )
if ( test -n "`egrep 'stderr' $file`" -a \
......@@ -599,22 +601,22 @@ extern "C" {\
fixlist="${fixlist}
broken_assert_stdio"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '1i\
#include <stdio.h>
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Broken_Assert_Stdlib fix
#
# Fix 14: Broken_Assert_Stdlib
#
case "$file" in ./assert.h )
if ( test -n "`egrep 'exit *\\(|abort *\\(' $file`" -a \
......@@ -623,44 +625,43 @@ extern "C" {\
fixlist="${fixlist}
broken_assert_stdlib"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '1i\
#ifdef __cplusplus\
#include <stdlib.h>\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Bsd43_Io_Macros fix
#
# Fix 15: Bsd43_Io_Macros
#
if ( test -n "`egrep 'BSD43__IO' $file`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
bsd43_io_macros"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/[ ]BSD43__IO[A-Z]*[ ]*(/s/(\(.\),/('\''\1'\'',/' \
-e '/#[ ]*define[ ]*[ ]BSD43__IO/s/'\''\([cgx]\)'\''/\1/g' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e '/#[ ]*define[ ]*[ ]BSD43__IO/s/'\''\([cgx]\)'\''/\1/g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi
fi # end of selection 'if'
# Cxx_Cmnt_Hpux fix
#
# Fix 16: Cxx_Cmnt_Hpux
#
case "$file" in ./sys/pci.h )
if ( test -n "`egrep 'System Private Structures' $file`"
......@@ -668,20 +669,20 @@ extern "C" {\
fixlist="${fixlist}
cxx_cmnt_hpux"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's|//.*$||g' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's|//.*$||g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Cxx_Cmnt_Irix fix
#
# Fix 17: Cxx_Cmnt_Irix
#
case "$file" in ./fam.h )
if ( test -n "`egrep 'indigo.esd' $file`"
......@@ -689,39 +690,39 @@ extern "C" {\
fixlist="${fixlist}
cxx_cmnt_irix"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's|//.*$||g' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's|//.*$||g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Cxx_Cmnt_Sunos fix
#
# Fix 18: Cxx_Cmnt_Sunos
#
case "$file" in ./sbusdev/audiovar.h | \
./sys/audiovar.h )
fixlist="${fixlist}
cxx_cmnt_sunos"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's|//.*$||g' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's|//.*$||g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Cxx_Cmnt_Vxworks fix
#
# Fix 19: Cxx_Cmnt_Vxworks
#
case "$file" in ./drv/netif/if_med.h )
if ( test -n "`egrep 'Wind River' $file`"
......@@ -729,49 +730,47 @@ extern "C" {\
fixlist="${fixlist}
cxx_cmnt_vxworks"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's|//.*$||g' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's|//.*$||g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Ecd_Cursor fix
#
# Fix 20: Ecd_Cursor
#
case "$file" in ./sunwindow/win_lock.h | \
./sunwindow/win_cursor.h )
fixlist="${fixlist}
ecd_cursor"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/ecd.cursor/ecd_cursor/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/ecd.cursor/ecd_cursor/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Else_Label fix
#
# Fix 21: Else_Label
#
if ( test -n "`egrep '^[ ]*#[ ]*else[ ]+[!-.0-~]' $file`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
else_label"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e ':loop
/\\$/N
......@@ -779,24 +778,23 @@ s/\\$/\\+++fixinc_eol+++/
/\\$/b loop
s/\\+++fixinc_eol+++/\\/g
s%^\([ ]*#[ ]*else\)[ ]*/[^*].*%\1%
s%^\([ ]*#[ ]*else\)[ ]*[^/ ].*%\1%' <&4 > ${DESTDIR}/$file.
exec 4<&-
s%^\([ ]*#[ ]*else\)[ ]*[^/ ].*%\1%' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi
fi # end of selection 'if'
# Endif_Label fix
#
# Fix 22: Endif_Label
#
if ( test -n "`egrep '^[ ]*#[ ]*endif[ ]+[!-.0-~]' $file`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
endif_label"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e ':loop
/\\$/N
......@@ -805,14 +803,15 @@ s/\\$/\\+++fixinc_eol+++/
s/\\+++fixinc_eol+++/\\/g
s%^\([ ]*#[ ]*endif\)[ ]*/[^*].*%\1%
s%^\([ ]*#[ ]*endif\)[ ]*\*[^/].*%\1%
s%^\([ ]*#[ ]*endif\)[ ]*[^/* ].*%\1%' <&4 > ${DESTDIR}/$file.
exec 4<&-
s%^\([ ]*#[ ]*endif\)[ ]*[^/* ].*%\1%' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi
fi # end of selection 'if'
# Hp_Inline fix
#
# Fix 23: Hp_Inline
#
case "$file" in ./sys/spinlock.h )
if ( test -n "`egrep 'include.*\"\\.\\./machine/' $file`"
......@@ -820,21 +819,21 @@ s%^\([ ]*#[ ]*endif\)[ ]*[^/* ].*%\1%' <&4 > ${DESTDIR}/$file.
fixlist="${fixlist}
hp_inline"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's,"../machine/inline.h",<machine/inline.h>,' \
-e 's,"../machine/psl.h",<machine/psl.h>,' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's,"../machine/psl.h",<machine/psl.h>,' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Hp_Sysfile fix
#
# Fix 24: Hp_Sysfile
#
case "$file" in ./sys/file.h )
if ( test -n "`egrep 'HPUX_SOURCE' $file`"
......@@ -842,20 +841,20 @@ s%^\([ ]*#[ ]*endif\)[ ]*[^/* ].*%\1%' <&4 > ${DESTDIR}/$file.
fixlist="${fixlist}
hp_sysfile"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/(\.\.\.)/(struct file * ...)/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/(\.\.\.)/(struct file * ...)/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Hpux_Cxx_Unready fix
#
# Fix 25: Hpux_Cxx_Unready
#
case "$file" in ./assert.h | \
./sys/mman.h )
......@@ -864,10 +863,8 @@ s%^\([ ]*#[ ]*endif\)[ ]*[^/* ].*%\1%' <&4 > ${DESTDIR}/$file.
fixlist="${fixlist}
hpux_cxx_unready"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '1i\
#ifdef __cplusplus\
......@@ -879,38 +876,40 @@ extern "C" {\
#ifdef __cplusplus\
}\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Hpux_Maxint fix
#
# Fix 26: Hpux_Maxint
#
case "$file" in ./sys/param.h )
fixlist="${fixlist}
hpux_maxint"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/^#[ ]*define[ ]*MAXINT[ ]/i\
#ifndef MAXINT
' \
-e '/^#[ ]*define[ ]*MAXINT[ ]/a\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Hpux_Systime fix
#
# Fix 27: Hpux_Systime
#
case "$file" in ./sys/time.h )
if ( test -n "`egrep '^extern struct sigevent;' $file`"
......@@ -918,20 +917,20 @@ extern "C" {\
fixlist="${fixlist}
hpux_systime"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/^extern struct sigevent;/struct sigevent;/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/^extern struct sigevent;/struct sigevent;/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Interactv_Add1 fix
#
# Fix 28: Interactv_Add1
#
case "$file" in ./stdio.h | \
./math.h | \
......@@ -945,20 +944,20 @@ extern "C" {\
fixlist="${fixlist}
interactv_add1"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/!defined(__STDC__) && !defined(_POSIX_SOURCE)/!defined(_POSIX_SOURCE)/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/!defined(__STDC__) && !defined(_POSIX_SOURCE)/!defined(_POSIX_SOURCE)/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Interactv_Add2 fix
#
# Fix 29: Interactv_Add2
#
case "$file" in ./math.h )
if ( test '(' -d /etc/conf/kconfig.d ')' -a \
......@@ -967,20 +966,20 @@ extern "C" {\
fixlist="${fixlist}
interactv_add2"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/fmod(double)/fmod(double, double)/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/fmod(double)/fmod(double, double)/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Interactv_Add3 fix
#
# Fix 30: Interactv_Add3
#
case "$file" in ./sys/limits.h )
if ( test '(' -d /etc/conf/kconfig.d ')' -a \
......@@ -989,121 +988,119 @@ extern "C" {\
fixlist="${fixlist}
interactv_add3"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/CHILD_MAX/s,/\* Max, Max,' \
-e '/OPEN_MAX/s,/\* Max, Max,' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e '/OPEN_MAX/s,/\* Max, Max,' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Io_Def_Quotes fix
#
# Fix 31: Io_Def_Quotes
#
if ( test -n "`egrep '[ ]_IO[A-Z]*[ ]*\\([A-Za-z]' $file`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
io_def_quotes"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/\([ ]_IO[A-Z]*[ ]*(\)\([A-Za-z]\),/\1'\''\2'\'',/' \
-e '/#[ ]*define[ ]*[ ]_IO/s/'\''\([cgxtf]\)'\''/\1/g' \
-e '/#[ ]*define[ ]*[ ]DESIOC/s/'\''\([cdgx]\)'\''/\1/g' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e '/#[ ]*define[ ]*[ ]DESIOC/s/'\''\([cdgx]\)'\''/\1/g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi
fi # end of selection 'if'
# Ioctl_Fix_Ctrl fix
#
# Fix 32: Ioctl_Fix_Ctrl
#
if ( test -n "`egrep 'CTRL[ ]' $file`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
ioctl_fix_ctrl"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/[^A-Z0-9_]CTRL[ ]*(/s/\([^'\'']\))/'\''\1'\'')/' \
-e '/[^A-Z0-9]_CTRL[ ]*(/s/\([^'\'']\))/'\''\1'\'')/' \
-e '/#[ ]*define[ ]*[ ]CTRL/s/'\''\([cgx]\)'\''/\1/g' \
-e '/#[ ]*define[ ]*[ ]_CTRL/s/'\''\([cgx]\)'\''/\1/g' \
-e '/#[ ]*define[ ]*[ ]BSD43_CTRL/s/'\''\([cgx]\)'\''/\1/g' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e '/#[ ]*define[ ]*[ ]BSD43_CTRL/s/'\''\([cgx]\)'\''/\1/g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi
fi # end of selection 'if'
# Ip_Missing_Semi fix
#
# Fix 33: Ip_Missing_Semi
#
case "$file" in ./netinet/ip.h )
fixlist="${fixlist}
ip_missing_semi"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/^struct/,/^};/s/}$/};/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e '/^struct/,/^};/s/}$/};/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Irix_Bogus_Cxx_Cmnt fix
#
# Fix 34: Irix_Bogus_Cxx_Cmnt
#
case "$file" in ./elf_abi.h | \
./elf.h )
fixlist="${fixlist}
irix_bogus_cxx_cmnt"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's@"/\*"\*/@"//"@' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's@"/\*"\*/@"//"@' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Irix_Multiline_Cmnt fix
#
# Fix 35: Irix_Multiline_Cmnt
#
case "$file" in ./sys/types.h )
fixlist="${fixlist}
irix_multiline_cmnt"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's@type of the result@type of the result */@' \
-e 's@of the sizeof@/* of the sizeof@' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's@of the sizeof@/* of the sizeof@' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Irix_Sockaddr fix
#
# Fix 36: Irix_Sockaddr
#
case "$file" in ./rpc/auth.h )
if ( test -n "`egrep 'authdes_create.*struct sockaddr' $file`"
......@@ -1111,42 +1108,42 @@ extern "C" {\
fixlist="${fixlist}
irix_sockaddr"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/authdes_create.*struct sockaddr/i\
struct sockaddr;
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Irix_Struct__File fix
#
# Fix 37: Irix_Struct__File
#
case "$file" in ./rpc/xdr.h )
fixlist="${fixlist}
irix_struct__file"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/xdrstdio_create.*struct __file_s/i\
struct __file_s;
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Isc_Fmod fix
#
# Fix 38: Isc_Fmod
#
case "$file" in ./math.h )
if ( test -n "`egrep 'fmod\\(double\\)' $file`"
......@@ -1154,20 +1151,20 @@ struct __file_s;
fixlist="${fixlist}
isc_fmod"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/fmod(double)/fmod(double, double)/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/fmod(double)/fmod(double, double)/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Isc_Sys_Limits fix
#
# Fix 39: Isc_Sys_Limits
#
case "$file" in ./sys/limits.h )
if ( test -n "`egrep 'CHILD_MAX' $file`"
......@@ -1175,21 +1172,21 @@ struct __file_s;
fixlist="${fixlist}
isc_sys_limits"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/CHILD_MAX/s,/\* Max, Max,' \
-e '/OPEN_MAX/s,/\* Max, Max,' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e '/OPEN_MAX/s,/\* Max, Max,' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Kandr_Concat fix
#
# Fix 40: Kandr_Concat
#
case "$file" in ./sparc/asm_linkage.h | \
./sun3/asm_linkage.h | \
......@@ -1214,20 +1211,20 @@ struct __file_s;
fixlist="${fixlist}
kandr_concat"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's|/\*\*/| ## |g' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's|/\*\*/| ## |g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Limits_Ifndefs fix
#
# Fix 41: Limits_Ifndefs
#
case "$file" in ./limits.h )
if ( test -z "`egrep 'ifndef[ ]+FLT_MIN' $file`"
......@@ -1235,10 +1232,8 @@ struct __file_s;
fixlist="${fixlist}
limits_ifndefs"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/[ ]FLT_MIN[ ]/i\
#ifndef FLT_MIN
......@@ -1275,15 +1270,17 @@ struct __file_s;
' \
-e '/[ ]DBL_DIG[ ]/a\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Lynx_Void_Int fix
#
# Fix 42: Lynx_Void_Int
#
case "$file" in ./curses.h )
if ( test -n "`egrep '#[ ]*define[ ]+void[ ]+int' $file`"
......@@ -1291,47 +1288,46 @@ struct __file_s;
fixlist="${fixlist}
lynx_void_int"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/#[ ]*define[ ][ ]*void[ ]int/d' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e '/#[ ]*define[ ][ ]*void[ ]int/d' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Lynxos_Fcntl_Proto fix
#
# Fix 43: Lynxos_Fcntl_Proto
#
case "$file" in ./fcntl.h )
fixlist="${fixlist}
lynxos_fcntl_proto"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/\(fcntl.*(int, int, \)int)/\1...)/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/\(fcntl.*(int, int, \)int)/\1...)/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# M88k_Bad_Hypot_Opt fix
#
# Fix 44: M88k_Bad_Hypot_Opt
#
case "$file" in ./math.h )
case "$target_canonical" in m88k-motorola-sysv3* )
fixlist="${fixlist}
m88k_bad_hypot_opt"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/extern double floor(), ceil(), fmod(), fabs();/extern double floor(), ceil(), fmod(), fabs _PARAMS((double));/' \
-e '/^extern double hypot();$/a\
......@@ -1347,47 +1343,53 @@ static __inline__ double fake_hypot (x, y)\
return fabs (hypot (x, y));\
}\
#define hypot fake_hypot
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for machine type test
esac
;; # case end for file name test
esac
# M88k_Bad_S_If fix
#
# Fix 45: M88k_Bad_S_If
#
case "$file" in ./sys/stat.h )
case "$target_canonical" in m88k-*-sysv3* )
if ( test -n "`egrep '#define[ ]+S_IS[A-Z]*(m)[ ]' $file`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
m88k_bad_s_if"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/^\(#define[ ]*S_IS[A-Z]*(m)\)[ ]*(m[ ]*&[ ]*\(S_IF[A-Z][A-Z][A-Z][A-Z]*\)[ ]*)/\1 (((m)\&S_IFMT)==\2)/' \
-e 's/^\(#define[ ]*S_IS[A-Z]*(m)\)[ ]*(m[ ]*&[ ]*\(0[0-9]*\)[ ]*)/\1 (((m)\&S_IFMT)==\2)/' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's/^\(#define[ ]*S_IS[A-Z]*(m)\)[ ]*(m[ ]*&[ ]*\(0[0-9]*\)[ ]*)/\1 (((m)\&S_IFMT)==\2)/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for machine type test
esac
;; # case end for file name test
esac
# M88k_Multi_Incl fix
#
# Fix 46: M88k_Multi_Incl
#
case "$file" in ./time.h )
case "$target_canonical" in m88k-tektronix-sysv3* )
if ( test -z "`egrep '#ifndef' $file`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
m88k_multi_incl"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
( echo Fixing $file, to protect against multiple inclusion. >&2
cpp_wrapper=`echo $file | sed -e 's,\.,_,g' -e 's,/,_,g'`
sed -e "1i\
......@@ -1396,30 +1398,32 @@ static __inline__ double fake_hypot (x, y)\
" \
-e "$a\
#endif /* ! __GCC_GOT_${cpp_wrapper}_ */
" ) <&4 > ${DESTDIR}/$file.
exec 4<&-
" ) < $infile > ${DESTDIR}/$file.
# 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}/$file.
then continue ; fi
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for machine type test
esac
;; # case end for file name test
esac
# Machine_Name fix
#
# Fix 47: Machine_Name
#
if ( test -n "`egrep '^#[ ]*(if|elif).*[^a-zA-Z0-9_](_*[MSRrhim]|[Mbimnpstuv])[a-zA-Z0-9_]' $file`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
machine_name"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e ':loop
/\\$/N
......@@ -1455,14 +1459,15 @@ s/\\+++fixinc_eol+++/\\/g
s/ unix / __unix__ /g
s/ vax / __vax__ /g
s/ \([a-zA-Z0-9_][a-zA-Z0-9_]*\) /\1/g
}' <&4 > ${DESTDIR}/$file.
exec 4<&-
}' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi
fi # end of selection 'if'
# Math_Exception fix
#
# Fix 48: Math_Exception
#
case "$file" in ./math.h )
if ( test -n "`egrep 'struct exception' $file`"
......@@ -1470,10 +1475,8 @@ s/\\+++fixinc_eol+++/\\/g
fixlist="${fixlist}
math_exception"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/struct exception/i\
#ifdef __cplusplus\
......@@ -1494,24 +1497,24 @@ s/\\+++fixinc_eol+++/\\/g
#ifdef __cplusplus\
#undef exception\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Math_Gcc_Ifndefs fix
#
# Fix 49: Math_Gcc_Ifndefs
#
case "$file" in ./math.h )
fixlist="${fixlist}
math_gcc_ifndefs"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
( dbl_max_def="`egrep 'define[ ]+DBL_MAX[ ]+.*' ${SRCDIR}/float.h 2>/dev/null`"
if ( test -n "${dbl_max_def}" \
......@@ -1531,30 +1534,31 @@ s/\\+++fixinc_eol+++/\\/g
-e '/define[ ]HUGE_VAL[ ]/a\
#endif
'
fi ) <&4 > ${DESTDIR}/$file.
exec 4<&-
fi ) < $infile > ${DESTDIR}/$file.
# 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}/$file.
then continue ; fi
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Motorola_Stupid_Opt fix
#
# Fix 50: Motorola_Stupid_Opt
#
case "$file" in ./math.h )
case "$target_canonical" in m88k-motorola-sysv3* )
if ( test -n "`egrep '^extern double hypot();$' $file`"
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
motorola_stupid_opt"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/^extern double hypot();$/a\
\/* Workaround a stupid Motorola optimization if one\
......@@ -1569,33 +1573,37 @@ static __inline__ double fake_hypot (x, y)\
return fabs (hypot (x, y));\
}\
#define hypot fake_hypot
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for machine type test
esac
;; # case end for file name test
esac
# Nested_Comment fix
#
# Fix 51: Nested_Comment
#
case "$file" in ./rpc/rpc.h )
fixlist="${fixlist}
nested_comment"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's@^\(/\*.*rpc/auth_des.h>.*\)/\*@\1*/ /*@' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's@^\(/\*.*rpc/auth_des.h>.*\)/\*@\1*/ /*@' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# News_Os_Recursion fix
#
# Fix 52: News_Os_Recursion
#
case "$file" in ./stdlib.h )
if ( test -n "`egrep '#include <stdlib.h>' $file`"
......@@ -1603,25 +1611,25 @@ static __inline__ double fake_hypot (x, y)\
fixlist="${fixlist}
news_os_recursion"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/^#include <stdlib.h>/i\
#ifdef BOGUS_RECURSION
' \
-e '/^#include <stdlib.h>/a\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Next_Math_Prefix fix
#
# Fix 53: Next_Math_Prefix
#
case "$file" in ./ansi/math.h )
if ( test -n "`egrep '^extern.*double.*__const__.*' $file`"
......@@ -1629,24 +1637,24 @@ static __inline__ double fake_hypot (x, y)\
fixlist="${fixlist}
next_math_prefix"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/^extern.*double.*__const__.*sqrt(/s/__const__//' \
-e '/^extern.*double.*__const__.*fabs(/s/__const__//' \
-e '/^extern.*double.*__const__.*cos(/s/__const__//' \
-e '/^extern.*double.*__const__.*hypot(/s/__const__//' \
-e '/^extern.*double.*__const__.*sin(/s/__const__//' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e '/^extern.*double.*__const__.*sin(/s/__const__//' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Next_Template fix
#
# Fix 54: Next_Template
#
case "$file" in ./bsd/libc.h )
if ( test -n "`egrep 'template' $file`"
......@@ -1654,21 +1662,21 @@ static __inline__ double fake_hypot (x, y)\
fixlist="${fixlist}
next_template"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/\(.*template\)/s/template//' \
-e '/extern.*volatile.*void.*abort/s/volatile//' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e '/extern.*volatile.*void.*abort/s/volatile//' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Next_Volitile fix
#
# Fix 55: Next_Volitile
#
case "$file" in ./ansi/stdlib.h )
if ( test -n "`egrep 'volatile' $file`"
......@@ -1676,21 +1684,21 @@ static __inline__ double fake_hypot (x, y)\
fixlist="${fixlist}
next_volitile"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/extern.*volatile.*void.*exit/s/volatile//' \
-e '/extern.*volatile.*void.*abort/s/volatile//' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e '/extern.*volatile.*void.*abort/s/volatile//' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Next_Wait_Union fix
#
# Fix 56: Next_Wait_Union
#
case "$file" in ./sys/wait.h )
if ( test -n "`egrep 'wait\\(union wait' $file`"
......@@ -1698,57 +1706,57 @@ static __inline__ double fake_hypot (x, y)\
fixlist="${fixlist}
next_wait_union"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's@wait(union wait@wait(void@' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's@wait(union wait@wait(void@' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# No_Double_Slash fix
#
if ( test -n "`egrep '//[^*]' $file`"
# Fix 57: No_Double_Slash
#
if ( test -n "`egrep '//[^*]' $file`" -a \
'(' -z "`echo ${f}|grep ++`" ')'
) > /dev/null 2>&1 ; then
fixlist="${fixlist}
no_double_slash"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/\/\/[^*]/s|//\(.*\)$|/* \1 */|' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e '/\/\/[^*]/s|//\(.*\)$|/* \1 */|' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi
fi # end of selection 'if'
# Nodeent_Syntax fix
#
# Fix 58: Nodeent_Syntax
#
case "$file" in ./netdnet/dnetdb.h )
fixlist="${fixlist}
nodeent_syntax"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/char.*na_addr *$/char *na_addr;/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/char.*na_addr *$/char *na_addr;/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Osf_Namespace_A fix
#
# Fix 59: Osf_Namespace_A
#
case "$file" in ./reg_types.h | \
./sys/lc_core.h )
......@@ -1757,22 +1765,22 @@ static __inline__ double fake_hypot (x, y)\
fixlist="${fixlist}
osf_namespace_a"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/regex_t/__regex_t/g' \
-e 's/regoff_t/__regoff_t/g' \
-e 's/regmatch_t/__regmatch_t/g' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's/regmatch_t/__regmatch_t/g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Osf_Namespace_B fix
#
# Fix 60: Osf_Namespace_B
#
case "$file" in ./regex.h )
if ( test '(' -r reg_types.h-a -r sys/lc_core.h-a -n "`grep '} regex_t;' reg_types.h`"-a -z "`grep __regex_t regex.h`" ')'
......@@ -1780,24 +1788,24 @@ static __inline__ double fake_hypot (x, y)\
fixlist="${fixlist}
osf_namespace_b"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/#include <reg_types.h>/a\
typedef __regex_t regex_t;\
typedef __regoff_t regoff_t;\
typedef __regmatch_t regmatch_t;
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Pthread_Page_Size fix
#
# Fix 61: Pthread_Page_Size
#
case "$file" in ./pthread.h )
if ( test -n "`egrep '^int __page_size' $file`"
......@@ -1805,20 +1813,20 @@ typedef __regmatch_t regmatch_t;
fixlist="${fixlist}
pthread_page_size"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/^int __page_size/extern int __page_size/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/^int __page_size/extern int __page_size/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Rs6000_Double fix
#
# Fix 62: Rs6000_Double
#
case "$file" in ./math.h )
if ( test -n "`egrep '[^a-zA-Z_]class\\(' $file`"
......@@ -1826,25 +1834,25 @@ typedef __regmatch_t regmatch_t;
fixlist="${fixlist}
rs6000_double"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/class[(]/i\
#ifndef __cplusplus
' \
-e '/class[(]/a\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Rs6000_Fchmod fix
#
# Fix 63: Rs6000_Fchmod
#
case "$file" in ./sys/stat.h )
if ( test -n "`egrep 'fchmod\\(char' $file`"
......@@ -1852,39 +1860,39 @@ typedef __regmatch_t regmatch_t;
fixlist="${fixlist}
rs6000_fchmod"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/fchmod(char \*/fchmod(int/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/fchmod(char \*/fchmod(int/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Rs6000_Param fix
#
# Fix 64: Rs6000_Param
#
case "$file" in ./stdio.h | \
./unistd.h )
fixlist="${fixlist}
rs6000_param"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's@rename(const char \*old, const char \*new)@rename(const char *_old, const char *_new)@' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's@rename(const char \*old, const char \*new)@rename(const char *_old, const char *_new)@' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Sony_Include fix
#
# Fix 65: Sony_Include
#
case "$file" in ./machine/machparam.h )
if ( test -n "`egrep '\"\\.\\./machine/endian.h\"' $file`"
......@@ -1892,20 +1900,20 @@ typedef __regmatch_t regmatch_t;
fixlist="${fixlist}
sony_include"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's@"../machine/endian.h"@<machine/endian.h>@' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's@"../machine/endian.h"@<machine/endian.h>@' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Statsswtch fix
#
# Fix 66: Statsswtch
#
case "$file" in ./rpcsvc/rstat.h )
if ( test -n "`egrep 'boottime$' $file`"
......@@ -1913,29 +1921,27 @@ typedef __regmatch_t regmatch_t;
fixlist="${fixlist}
statsswtch"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/boottime$/boottime;/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/boottime$/boottime;/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Stdio_Va_List fix
#
# Fix 67: Stdio_Va_List
#
case "$file" in ./stdio.h )
fixlist="${fixlist}
stdio_va_list"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
( if ( egrep "__need___va_list" $file ) > /dev/null 2>&1 ; then
:
else
......@@ -1953,19 +1959,21 @@ typedef __regmatch_t regmatch_t;
-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@' ) <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's@_Va_LIST@_VA_LIST@' ) < $infile > ${DESTDIR}/$file.
# 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}/$file.
then continue ; fi
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Sun_Bogus_Ifdef fix
#
# Fix 68: Sun_Bogus_Ifdef
#
case "$file" in ./hsfs/hsfs_spec.h | \
./hsfs/iso_spec.h )
......@@ -1974,20 +1982,20 @@ typedef __regmatch_t regmatch_t;
fixlist="${fixlist}
sun_bogus_ifdef"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/\#ifdef __i386__ || __vax__/\#if __i386__ || __vax__/g' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/\#ifdef __i386__ || __vax__/\#if __i386__ || __vax__/g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Sun_Bogus_Ifdef_Sun4c fix
#
# Fix 69: Sun_Bogus_Ifdef_Sun4c
#
case "$file" in ./hsfs/hsnode.h )
if ( test -n "`egrep '#ifdef __i386__ || __sun4c__' $file`"
......@@ -1995,20 +2003,20 @@ typedef __regmatch_t regmatch_t;
fixlist="${fixlist}
sun_bogus_ifdef_sun4c"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/\#ifdef __i386__ || __sun4c__/\#if __i386__ || __sun4c__/g' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/\#ifdef __i386__ || __sun4c__/\#if __i386__ || __sun4c__/g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Sun_Catmacro fix
#
# Fix 70: Sun_Catmacro
#
case "$file" in ./pixrect/memvar.h )
if ( test -n "`egrep '^#define[ ]+CAT(a,b)' $file`"
......@@ -2016,10 +2024,8 @@ typedef __regmatch_t regmatch_t;
fixlist="${fixlist}
sun_catmacro"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/^#define[ ]CAT(a,b)/ i\
#ifdef __STDC__ \
......@@ -2028,36 +2034,38 @@ typedef __regmatch_t regmatch_t;
' \
-e '/^#define[ ]CAT(a,b)/ a\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Sun_Malloc fix
#
# Fix 71: Sun_Malloc
#
case "$file" in ./malloc.h )
fixlist="${fixlist}
sun_malloc"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/typedef[ ]char \* malloc_t/typedef void \* malloc_t/g' \
-e 's/int[ ][ ]*free/void free/g' \
-e 's/char\([ ]*\*[ ]*malloc\)/void\1/g' \
-e 's/char\([ ]*\*[ ]*realloc\)/void\1/g' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's/char\([ ]*\*[ ]*realloc\)/void\1/g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Sun_Memcpy fix
#
# Fix 72: 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`"
......@@ -2065,10 +2073,8 @@ typedef __regmatch_t regmatch_t;
fixlist="${fixlist}
sun_memcpy"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '1i\
/* This file was generated by fixincludes */\
......@@ -2091,15 +2097,17 @@ extern int memcmp();\
\
#endif /* __memory_h__ */
' \
-e '1,$d' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e '1,$d' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Sun_Rusers_Semi fix
#
# Fix 73: Sun_Rusers_Semi
#
case "$file" in ./rpcsvc/rusers.h )
if ( test -n "`egrep '_cnt$' $file`"
......@@ -2107,20 +2115,20 @@ extern int memcmp();\
fixlist="${fixlist}
sun_rusers_semi"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/^struct/,/^};/s/_cnt$/_cnt;/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e '/^struct/,/^};/s/_cnt$/_cnt;/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Sun_Signal fix
#
# Fix 74: Sun_Signal
#
case "$file" in ./sys/signal.h | \
./signal.h )
......@@ -2129,10 +2137,8 @@ extern int memcmp();\
fixlist="${fixlist}
sun_signal"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/^void (\*signal())();$/i\
#ifdef __cplusplus\
......@@ -2141,62 +2147,64 @@ void (*signal(...))(...);\
' \
-e '/^void (\*signal())();$/a\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Sun_Xdr_Proto fix
#
# Fix 75: Sun_Xdr_Proto
#
case "$file" in ./rpc/xdr.h )
fixlist="${fixlist}
sun_xdr_proto"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/^\(.*\)\*\(x_.*\)();\(.*\)/\
#ifdef __cplusplus\
\1*\2(...);\3\
#else\
\1*\2();\3\
#endif/g' <&4 > ${DESTDIR}/$file.
exec 4<&-
#endif/g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Sunos_Large_Macro fix
#
# Fix 76: Sunos_Large_Macro
#
case "$file" in ./sundev/ipi_error.h )
fixlist="${fixlist}
sunos_large_macro"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
( echo "Removing incorrect fix to SunOS <sundev/ipi_error.h>" >&2
rm -f ${DESTDIR}/$file ${DESTDIR}/$file.
cat > /dev/null ) <&4 > ${DESTDIR}/$file.
exec 4<&-
cat > /dev/null ) < $infile > ${DESTDIR}/$file.
# 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}/$file.
then continue ; fi
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Sunos_Matherr_Decl fix
#
# Fix 77: Sunos_Matherr_Decl
#
case "$file" in ./math.h )
if ( test '(' "`fgrep 'struct exception' $file | line`" != 'struct exception {' ')'
......@@ -2204,40 +2212,40 @@ cat > /dev/null ) <&4 > ${DESTDIR}/$file.
fixlist="${fixlist}
sunos_matherr_decl"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/matherr/i\
struct exception;
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Sunos_Strlen fix
#
# Fix 78: Sunos_Strlen
#
case "$file" in ./strings.h )
fixlist="${fixlist}
sunos_strlen"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/int[ ]*strlen();/__SIZE_TYPE__ strlen();/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/int[ ]*strlen();/__SIZE_TYPE__ strlen();/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Systypes fix
#
# Fix 79: Systypes
#
case "$file" in ./sys/types.h | \
./stdlib.h | \
......@@ -2250,10 +2258,8 @@ struct exception;
fixlist="${fixlist}
systypes"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/^[ ]**[ ]*typedef unsigned int size_t;/N' \
-e 's/^\([ ]*\*[ ]*typedef unsigned int size_t;\n[ ]*\*\/\)/\1\
......@@ -2283,15 +2289,17 @@ typedef __SIZE_TYPE__ size_t;\
-e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/a\
#endif
' \
-e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/typedef __WCHAR_TYPE__ wchar_t/' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/typedef __WCHAR_TYPE__ wchar_t/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Systypes_For_Aix fix
#
# Fix 80: Systypes_For_Aix
#
case "$file" in ./sys/types.h )
if ( test -n "`egrep 'typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t' $file`"
......@@ -2299,10 +2307,8 @@ typedef __SIZE_TYPE__ size_t;\
fixlist="${fixlist}
systypes_for_aix"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t/i\
#ifndef _GCC_SIZE_T\
......@@ -2310,24 +2316,24 @@ typedef __SIZE_TYPE__ size_t;\
' \
-e '/typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t/a\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Sysv68_String fix
#
# Fix 81: Sysv68_String
#
case "$file" in ./string.h )
fixlist="${fixlist}
sysv68_string"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/extern[ ]*int[ ]*strlen();/extern unsigned int strlen();/' \
-e 's/extern[ ]*int[ ]*ffs[ ]*(long);/extern int ffs(int);/' \
......@@ -2339,23 +2345,25 @@ typedef __SIZE_TYPE__ size_t;\
extern unsigned int\
\2/' \
-e '/^extern int$/N' \
-e 's/^extern int\(\n strlen(),\)/extern size_t\1/' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's/^extern int\(\n strlen(),\)/extern size_t\1/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Sysz_Stdlib_For_Sun fix
#
# Fix 82: Sysz_Stdlib_For_Sun
#
case "$file" in ./stdlib.h )
case "$target_canonical" in *-sun-* | \
m88k-*-sysv3* )
fixlist="${fixlist}
sysz_stdlib_for_sun"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/int abort/void abort/g' \
-e 's/int free/void free/g' \
......@@ -2369,23 +2377,25 @@ extern unsigned int\
' \
-e '/typedef[ a-zA-Z_]*[ ]size_t[ ]*;/a\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for machine type test
esac
;; # case end for file name test
esac
# Sysz_Stdtypes_For_Sun fix
#
# Fix 83: Sysz_Stdtypes_For_Sun
#
case "$file" in ./sys/stdtypes.h )
fixlist="${fixlist}
sysz_stdtypes_for_sun"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/[ ]size_t.*;/i\
#ifndef _GCC_SIZE_T\
......@@ -2407,32 +2417,34 @@ extern unsigned int\
' \
-e '/[ ]wchar_t.*;/a\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Tinfo_Cplusplus fix
#
# Fix 84: Tinfo_Cplusplus
#
case "$file" in ./tinfo.h )
fixlist="${fixlist}
tinfo_cplusplus"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/[ ]_cplusplus/ __cplusplus/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/[ ]_cplusplus/ __cplusplus/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Ultrix_Ansi_Compat fix
#
# Fix 85: Ultrix_Ansi_Compat
#
case "$file" in ./ansi_compat.h )
if ( test -n "`egrep 'ULTRIX' $file`"
......@@ -2440,54 +2452,52 @@ extern unsigned int\
fixlist="${fixlist}
ultrix_ansi_compat"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '1i\
/* This file intentionally left blank. */
' \
-e '1,$d' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e '1,$d' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Ultrix_Atof_Param fix
#
# Fix 86: Ultrix_Atof_Param
#
case "$file" in ./math.h )
fixlist="${fixlist}
ultrix_atof_param"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's@atof(\([ ]*char[ ]*\*[^)]*\))@atof(const \1)@' \
-e 's@inline int abs(int [a-z][a-z]*) {.*}@extern "C" int abs(int);@' \
-e 's@inline double abs(double [a-z][a-z]*) {.*}@@' \
-e 's@inline int sqr(int [a-z][a-z]*) {.*}@@' \
-e 's@inline double sqr(double [a-z][a-z]*) {.*}@@' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's@inline double sqr(double [a-z][a-z]*) {.*}@@' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Ultrix_Const fix
#
# Fix 87: Ultrix_Const
#
case "$file" in ./stdio.h )
fixlist="${fixlist}
ultrix_const"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's@perror( char \*__s );@perror( const char *__s );@' \
-e 's@fputs( char \*__s,@fputs( const char *__s,@' \
......@@ -2497,14 +2507,16 @@ extern unsigned int\
-e 's@scanf( char \*__format,@scanf( const char *__format,@' \
-e 's@sscanf( char \*__s, char \*__format,@sscanf( const char *__s, const char *__format,@' \
-e 's@popen(char \*, char \*);@popen(const char *, const char *);@' \
-e 's@tempnam(char\*,char\*);@tempnam(const char*,const char*);@' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's@tempnam(char\*,char\*);@tempnam(const char*,const char*);@' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Ultrix_Ifdef fix
#
# Fix 88: Ultrix_Ifdef
#
case "$file" in ./sys/file.h )
if ( test -n "`egrep '#ifdef KERNEL' $file`"
......@@ -2512,38 +2524,38 @@ extern unsigned int\
fixlist="${fixlist}
ultrix_ifdef"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/#ifdef KERNEL/#if defined(KERNEL)/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/#ifdef KERNEL/#if defined(KERNEL)/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Ultrix_Nested_Cmnt fix
#
# Fix 89: Ultrix_Nested_Cmnt
#
case "$file" in ./rpc/svc.h )
fixlist="${fixlist}
ultrix_nested_cmnt"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's@^\( \* int protocol; \)/\*@\1*/ /*@' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's@^\( \* int protocol; \)/\*@\1*/ /*@' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# Ultrix_Static fix
#
# Fix 90: Ultrix_Static
#
case "$file" in ./machine/cpu.h )
if ( test -n "`egrep '#include \"r[34]_cpu' $file`"
......@@ -2551,22 +2563,22 @@ extern unsigned int\
fixlist="${fixlist}
ultrix_static"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/^static struct tlb_pid_state/struct tlb_pid_state/' \
-e 's/^#include "r3_cpu\.h"$/#include <machine\/r3_cpu\.h>/' \
-e 's/^#include "r4_cpu\.h"$/#include <machine\/r4_cpu\.h>/' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's/^#include "r4_cpu\.h"$/#include <machine\/r4_cpu\.h>/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Undefine_Null fix
#
# Fix 91: Undefine_Null
#
if ( test -n "`egrep '^#[ ]*define[ ]*[ ]NULL[ ]' $file`" -a \
-z "`egrep '#[ ]*(ifn|un)def[ ]*[ ]NULL($|[ ])' $file`"
......@@ -2574,21 +2586,20 @@ extern unsigned int\
fixlist="${fixlist}
undefine_null"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/^#[ ]*define[ ][ ]*NULL[ ]/i\
#undef NULL
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi
fi # end of selection 'if'
# Va_I960_Macro fix
#
# Fix 92: Va_I960_Macro
#
case "$file" in ./arch/i960/archI960.h )
if ( test -n "`egrep '__(vsiz|vali|vpad|alignof__)' $file`"
......@@ -2596,23 +2607,23 @@ extern unsigned int\
fixlist="${fixlist}
va_i960_macro"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/__vsiz/__vxvsiz/' \
-e 's/__vali/__vxvali/' \
-e 's/__vpad/__vxvpad/' \
-e 's/__alignof__/__vxalignof__/' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's/__alignof__/__vxalignof__/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Void_Null fix
#
# Fix 93: Void_Null
#
case "$file" in ./curses.h | \
./dbm.h | \
......@@ -2630,20 +2641,20 @@ extern unsigned int\
fixlist="${fixlist}
void_null"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/^#[ ]*define[ ]*NULL[ ]*((void[ ]*\*)0)/#define NULL 0/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/^#[ ]*define[ ]*NULL[ ]*((void[ ]*\*)0)/#define NULL 0/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Vxworks_Gcc_Problem fix
#
# Fix 94: Vxworks_Gcc_Problem
#
case "$file" in ./types/vxTypesBase.h )
if ( test -n "`egrep '__GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__' $file`"
......@@ -2651,10 +2662,8 @@ extern unsigned int\
fixlist="${fixlist}
vxworks_gcc_problem"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/#ifdef __GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__/#if 1/' \
-e '/[ ]size_t/i\
......@@ -2677,15 +2686,17 @@ extern unsigned int\
' \
-e '/[ ]wchar_t/a\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Vxworks_Needs_Vxtypes fix
#
# Fix 95: Vxworks_Needs_Vxtypes
#
case "$file" in ./time.h )
if ( test -n "`egrep 'uint_t[ ][ ]*_clocks_per_sec' $file`"
......@@ -2693,20 +2704,20 @@ extern unsigned int\
fixlist="${fixlist}
vxworks_needs_vxtypes"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/uint_t/unsigned int/' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/uint_t/unsigned int/' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Vxworks_Needs_Vxworks fix
#
# Fix 96: Vxworks_Needs_Vxworks
#
case "$file" in ./sys/stat.h )
if ( test -n "`egrep '#[ ]define[ ][ ]*__INCstath' $file`" -a \
......@@ -2717,22 +2728,22 @@ extern unsigned int\
fixlist="${fixlist}
vxworks_needs_vxworks"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/#[ ]define[ ][ ]*__INCstath/a\
#include <types/vxTypesOld.h>
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# Vxworks_Time fix
#
# Fix 97: Vxworks_Time
#
case "$file" in ./time.h )
if ( test -n "`egrep 'VOIDFUNCPTR' $file`" -a \
......@@ -2741,10 +2752,8 @@ extern unsigned int\
fixlist="${fixlist}
vxworks_time"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/VOIDFUNCPTR/i\
#ifndef __gcc_VOIDFUNCPTR_defined\
......@@ -2756,15 +2765,17 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
#define __gcc_VOIDFUNCPTR_defined\
#endif
' \
-e 's/VOIDFUNCPTR/__gcc_VOIDFUNCPTR/g' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's/VOIDFUNCPTR/__gcc_VOIDFUNCPTR/g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# X11_Class fix
#
# Fix 98: X11_Class
#
case "$file" in ./X11/ShellP.h )
if ( test -z "`egrep '__cplusplus' $file`"
......@@ -2772,10 +2783,8 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
fixlist="${fixlist}
x11_class"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/char [*]class;/i\
#ifdef __cplusplus\
......@@ -2784,15 +2793,17 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
' \
-e '/char [*]class;/a\
#endif
' <&4 > ${DESTDIR}/$file.
exec 4<&-
' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# X11_Class_Usage fix
#
# Fix 99: X11_Class_Usage
#
case "$file" in ./Xm/BaseClassI.h )
if ( test -z "`egrep '__cplusplus' $file`"
......@@ -2800,20 +2811,20 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
fixlist="${fixlist}
x11_class_usage"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's/ class[)]/ c_class)/g' <&4 > ${DESTDIR}/$file.
exec 4<&-
sed -e 's/ class[)]/ c_class)/g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# X11_New fix
#
# Fix 100: X11_New
#
case "$file" in ./Xm/Traversal.h )
if ( test -z "`egrep '__cplusplus' $file`"
......@@ -2821,10 +2832,8 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
fixlist="${fixlist}
x11_new"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e '/Widget old, new;/i\
#ifdef __cplusplus\
......@@ -2834,33 +2843,33 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
-e '/Widget old, new;/a\
#endif
' \
-e 's/Widget new,/Widget c_new,/g' <&4 > ${DESTDIR}/$file.
exec 4<&-
-e 's/Widget new,/Widget c_new,/g' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
fi ;;
fi # end of selection 'if'
;; # case end for file name test
esac
# X11_Sprintf fix
#
# Fix 101: X11_Sprintf
#
case "$file" in ./X11*/Xmu.h )
fixlist="${fixlist}
x11_sprintf"
if [ ! -r ${DESTDIR}/$file ]
then exec 4< $file
else exec 4< ${DESTDIR}/$file ; fi
if test $? -ne 0
then continue ; fi
then infile=$file
else infile=${DESTDIR}/$file ; fi
sed -e 's,^extern char \* sprintf();$,#ifndef __STDC__\
extern char * sprintf();\
#endif /* !defined __STDC__ */,' <&4 > ${DESTDIR}/$file.
exec 4<&-
#endif /* !defined __STDC__ */,' \
< $infile > ${DESTDIR}/$file.
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file ;;
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
;; # case end for file name test
esac
# IF the output has been removed OR it is unchanged,
# THEN ensure the output is gone
# ELSE look for local directory include syntax
......
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