diff options
author | Bruce Korb <bkorb@gnu.org> | 2004-01-20 23:49:34 +0000 |
---|---|---|
committer | Bruce Korb <korbb@gcc.gnu.org> | 2004-01-20 23:49:34 +0000 |
commit | 793146e38d245814e821f34a180a63bf93810a7c (patch) | |
tree | 47b8e16637a98552cb0a528d681cf21b1d11a2da /gcc/fixinc/inclhack.def | |
parent | fdb33708b4393f5794a726497c71aadc5d9dfe65 (diff) | |
download | gcc-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/inclhack.def')
-rw-r--r-- | gcc/fixinc/inclhack.def | 56 |
1 files changed, 31 insertions, 25 deletions
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 = { |