aboutsummaryrefslogtreecommitdiff
path: root/gcc/fixinc
diff options
context:
space:
mode:
authorBruce Korb <bkorb@gnu.org>2004-01-20 23:49:34 +0000
committerBruce Korb <korbb@gcc.gnu.org>2004-01-20 23:49:34 +0000
commit793146e38d245814e821f34a180a63bf93810a7c (patch)
tree47b8e16637a98552cb0a528d681cf21b1d11a2da /gcc/fixinc
parentfdb33708b4393f5794a726497c71aadc5d9dfe65 (diff)
downloadgcc-793146e38d245814e821f34a180a63bf93810a7c.zip
gcc-793146e38d245814e821f34a180a63bf93810a7c.tar.gz
gcc-793146e38d245814e821f34a180a63bf93810a7c.tar.bz2
reorder struct exception hacks and only bypass glibc for proper C++ handling
From-SVN: r76240
Diffstat (limited to 'gcc/fixinc')
-rw-r--r--gcc/fixinc/fixincl.x102
-rw-r--r--gcc/fixinc/inclhack.def56
2 files changed, 82 insertions, 76 deletions
diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x
index 94caee7..9c85fd6 100644
--- a/gcc/fixinc/fixincl.x
+++ b/gcc/fixinc/fixincl.x
@@ -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.
*
@@ -1751,6 +1751,48 @@ static const char* apzEcd_CursorPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * 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
*/
tSCC zFreebsd_Gcc3_BreakageName[] =
@@ -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[] = {
@@ -4982,48 +5024,6 @@ void\t(*signal(...))(...);\n\
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * 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
*/
tSCC zSunos_StrlenName[] =
@@ -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,
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def
index 68fbaf5..9459f87 100644
--- a/gcc/fixinc/inclhack.def
+++ b/gcc/fixinc/inclhack.def
@@ -1056,6 +1056,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
* (by design?) when __GNUC__ is set beyond 2.
@@ -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"
@@ -2809,25 +2834,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.
*/
fix = {