Mail Archives: djgpp-workers/2003/10/26/06:40:01
Hello.
Eli Zaretskii wrote:
>
> > Date: Sat, 25 Oct 2003 20:16:28 +0100
> > From: "Richard Dawe" <rich AT phekda DOT freeserve DOT co DOT uk>
> >
> > libstdc++ from gcc 3.2.1 fails to build, because there are clashes
> > between math.h and ieeefp.h. The culprits are the macros
> > isnan and isinf defined in <math.h>. ieeefp.h declares functions
> > called isnan and isinf. If <math.h> is included before ieeefp.h,
> > a parse error will occur, because of the macro expansion
> > of isnan and ininf.
> >
> > Below is a patch to fix this. Since isnan and isinf are now macros,
> > I've removed the declaration of their functions.
>
> I'm probably missing something here: why does ieeefp.h declare those
> functions, and where/when is ieeefp.h supposed to be used?
As far as I can tell, it's for libm and the test suite.
I don't know the reason. I guess ieeefp.h as a good place to put these
functions.
> > Perhaps it would be better to protect them with #ifdef isnan/#endif,
> > etc. sections?
>
> Isn't the following trick enough to solve the problem?
>
> extern int (isnan)(double);
>
> That is, surround the function's name with parens.
Yes, that works.
I'll send a new patch, once I've tested building with gcc 3.2.1.
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
"You can't evaluate a man by logic alone." -- McCoy, "I, Mudd", Star Trek
- Raw text -