Mail Archives: djgpp/1998/06/04/03:16:23
In article <3574046C DOT EBFE2F25 AT larc DOT nasa DOT gov>,
"Nathan T. Moore" <n DOT t DOT moore AT larc DOT nasa DOT gov> wrote:
> it *seems* like there is a missing #ifdef ... #endif
> in a header file somewhere, but I could be wrong.
That's what I thought, too. So I went into math.h and
inserted a couple of lines...
#ifndef SHUT_UP_DUPLICATE_EXCEPTION
struct exception {
int type;
char *name;
double arg1;
double arg2;
double retval;
};
#endif
and further down (optionally, since before I added it, the errors
were already gone, but it seemed cleaner to add it)
#ifndef SHUT_UP_DUPLICATE_EXCEPTION
extern int matherr(struct exception *);
#endif
I think you can see what I inserted.
Then all you do is, before you #include <math.h>, if you're going
to use any Standard Template Library, just
#define SHUT_UP_DUPLICATE_EXCEPTION
It's that easy.
But it's a hack.
I wish the "struct exception" could be renamed, but apparently
"struct exception" is part of the BSD UNIX standard for numerics,
and the other "exception" is part of the ANSI C++ standard, and
there is a name conflict. I don't use the BSD UNIX stuff, and math.h
is easier to understand, therefore, this hack.
Namespaces might help fix this in a future GCC.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
- Raw text -