reorder struct exception hacks and only bypass glibc for proper C++ handling

From-SVN: r76240
This commit is contained in:
Bruce Korb 2004-01-20 23:49:34 +00:00 committed by Bruce Korb
parent fdb33708b4
commit 793146e38d
3 changed files with 88 additions and 76 deletions

View File

@ -1,3 +1,9 @@
2004-01-20 Bruce Korb <bkorb@gnu.org>
* fixinc/inclhack.def(math_exception): bypass only for glibc.
(matherr_decl): rename & relocate as exception_structure.
This fix must precede the math_exception fix.
2004-01-20 Roger Sayle <roger@eyesopen.com>
* fold-const.c (fold_convert): Rename to fold_convert_const.

View File

@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
* It has been AutoGen-ed Tuesday December 23, 2003 at 01:59:31 PM MET
* It has been AutoGen-ed Tuesday January 20, 2004 at 03:43:24 PM PST
* From the definitions inclhack.def
* and the template file fixincl
*/
/* DO NOT CVS-MERGE THIS FILE, EITHER Tue Dec 23 13:59:32 MET 2003
/* DO NOT CVS-MERGE THIS FILE, EITHER Tue Jan 20 15:43:24 PST 2004
*
* You must regenerate it. Use the ./genfixes script.
*
@ -1749,6 +1749,48 @@ static const char* apzEcd_CursorPatch[] = {
"ecd_cursor",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Exception_Structure fix
*/
tSCC zException_StructureName[] =
"exception_structure";
/*
* File name selection pattern
*/
tSCC zException_StructureList[] =
"|math.h|";
/*
* Machine/OS name selection pattern
*/
#define apzException_StructureMachs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
tSCC zException_StructureSelect0[] =
"matherr";
/*
* content bypass pattern - skip fix if pattern found
*/
tSCC zException_StructureBypass0[] =
"matherr.*(struct exception|__MATH_EXCEPTION)";
#define EXCEPTION_STRUCTURE_TEST_CT 2
static tTestDesc aException_StructureTests[] = {
{ TT_NEGREP, zException_StructureBypass0, (regex_t*)NULL },
{ TT_EGREP, zException_StructureSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Exception_Structure
*/
static const char* apzException_StructurePatch[] = {
"wrap",
"struct exception;\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Freebsd_Gcc3_Breakage fix
@ -3294,7 +3336,7 @@ tSCC zMath_ExceptionSelect0[] =
* content bypass pattern - skip fix if pattern found
*/
tSCC zMath_ExceptionBypass0[] =
"__cplusplus";
"We have a problem when using C\\+\\+";
#define MATH_EXCEPTION_TEST_CT 2
static tTestDesc aMath_ExceptionTests[] = {
@ -4980,48 +5022,6 @@ void\t(*signal(...))(...);\n\
#endif",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Sunos_Matherr_Decl fix
*/
tSCC zSunos_Matherr_DeclName[] =
"sunos_matherr_decl";
/*
* File name selection pattern
*/
tSCC zSunos_Matherr_DeclList[] =
"|math.h|";
/*
* Machine/OS name selection pattern
*/
#define apzSunos_Matherr_DeclMachs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
tSCC zSunos_Matherr_DeclSelect0[] =
"matherr";
/*
* content bypass pattern - skip fix if pattern found
*/
tSCC zSunos_Matherr_DeclBypass0[] =
"matherr.*(struct exception|__MATH_EXCEPTION)";
#define SUNOS_MATHERR_DECL_TEST_CT 2
static tTestDesc aSunos_Matherr_DeclTests[] = {
{ TT_NEGREP, zSunos_Matherr_DeclBypass0, (regex_t*)NULL },
{ TT_EGREP, zSunos_Matherr_DeclSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Sunos_Matherr_Decl
*/
static const char* apzSunos_Matherr_DeclPatch[] = {
"wrap",
"struct exception;\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Sunos_Strlen fix
@ -6577,6 +6577,7 @@ typedef enum {
DEC_INTERN_ASM_FIXIDX,
DJGPP_WCHAR_H_FIXIDX,
ECD_CURSOR_FIXIDX,
EXCEPTION_STRUCTURE_FIXIDX,
FREEBSD_GCC3_BREAKAGE_FIXIDX,
GNU_TYPES_FIXIDX,
HP_INLINE_FIXIDX,
@ -6660,7 +6661,6 @@ typedef enum {
SUN_MALLOC_FIXIDX,
SUN_RUSERS_SEMI_FIXIDX,
SUN_SIGNAL_FIXIDX,
SUNOS_MATHERR_DECL_FIXIDX,
SUNOS_STRLEN_FIXIDX,
SVR4__P_FIXIDX,
SVR4_DISABLE_OPT_FIXIDX,
@ -6909,6 +6909,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
ECD_CURSOR_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aEcd_CursorTests, apzEcd_CursorPatch, 0 },
{ zException_StructureName, zException_StructureList,
apzException_StructureMachs,
EXCEPTION_STRUCTURE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aException_StructureTests, apzException_StructurePatch, 0 },
{ zFreebsd_Gcc3_BreakageName, zFreebsd_Gcc3_BreakageList,
apzFreebsd_Gcc3_BreakageMachs,
FREEBSD_GCC3_BREAKAGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@ -7324,11 +7329,6 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
SUN_SIGNAL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSun_SignalTests, apzSun_SignalPatch, 0 },
{ zSunos_Matherr_DeclName, zSunos_Matherr_DeclList,
apzSunos_Matherr_DeclMachs,
SUNOS_MATHERR_DECL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSunos_Matherr_DeclTests, apzSunos_Matherr_DeclPatch, 0 },
{ zSunos_StrlenName, zSunos_StrlenList,
apzSunos_StrlenMachs,
SUNOS_STRLEN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,

View File

@ -1055,6 +1055,26 @@ fix = {
};
/*
* math.h on SunOS 4 puts the declaration of matherr before the definition
* of struct exception, so the prototype (added by fixproto) causes havoc.
* This must appear before the math_exception fix.
*/
fix = {
hackname = exception_structure;
files = math.h;
/* If matherr has a prototype already, the header needs no fix. */
bypass = 'matherr.*(struct exception|__MATH_EXCEPTION)';
select = matherr;
c_fix = wrap;
c_fix_arg = "struct exception;\n";
test_text = "extern int matherr();";
};
/*
* Between 8/24/1998 and 2/17/2001, FreeBSD system headers presume
* neither the existence of GCC 3 nor its exact feature set yet break
@ -1856,11 +1876,10 @@ fix = {
/*
* Some math.h files define struct exception (it's in the System V
* Interface Definition), which conflicts with
* the class exception defined in the C++ file std/stdexcept.h. We
* redefine it to __math_exception. This is not a great fix, but I
* haven't been able to think of anything better.
* Note that we have to put the #ifdef/#endif blocks at beginning
* Interface Definition), which conflicts with the class exception defined
* in the C++ file std/stdexcept.h. We redefine it to __math_exception.
* This is not a great fix, but I haven't been able to think of anything
* better. Note that we have to put the #ifdef/#endif blocks at beginning
* and end of file, because fixproto runs after us and may insert
* additional references to struct exception.
*/
@ -1868,7 +1887,13 @@ fix = {
hackname = math_exception;
files = math.h;
select = "struct exception";
bypass = '__cplusplus';
/*
* This should be bypassed on __cplusplus, but some supposedly C++ C++
* aware headers, such as Solaris 8 and 9, don't wrap their struct
* exception either. So currently we bypass only for glibc, based on a
* comment in the fixed glibc header. Ick.
*/
bypass = 'We have a problem when using C\+\+';
c_fix = wrap;
c_fix_arg = "#ifdef __cplusplus\n"
@ -2808,25 +2833,6 @@ fix = {
};
/*
* math.h on SunOS 4 puts the declaration of matherr before the definition
* of struct exception, so the prototype (added by fixproto) causes havoc.
*/
fix = {
hackname = sunos_matherr_decl;
files = math.h;
/* If matherr has a prototype already, the header needs no fix. */
bypass = 'matherr.*(struct exception|__MATH_EXCEPTION)';
select = matherr;
c_fix = wrap;
c_fix_arg = "struct exception;\n";
test_text = "extern int matherr();";
};
/*
* Correct the return type for strlen in strings.h in SunOS 4.
*/