X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f Date: Sat, 25 Oct 2003 20:16:28 +0100 From: "Richard Dawe" Sender: rich AT phekda DOT freeserve DOT co DOT uk To: djgpp-workers AT delorie DOT com X-Mailer: Emacs 21.3.50 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6 Subject: Clash between math.h and ieeefp.h [PATCH] Message-Id: Reply-To: djgpp-workers AT delorie DOT com Hello. 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 . ieeefp.h declares functions called isnan and isinf. If 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. Perhaps it would be better to protect them with #ifdef isnan/#endif, etc. sections? OTOH it might be better to stop using the non-standard functions and switch to our standard macros in the code that uses the isnan, ininf functions. These functions are used by libm and the Cygnus test suite. OK to commit? Bye, Rich =] Index: include/ieeefp.h =================================================================== RCS file: /cvs/djgpp/djgpp/include/ieeefp.h,v retrieving revision 1.1 diff -p -u -3 -r1.1 ieeefp.h --- include/ieeefp.h 25 Jul 1998 19:06:56 -0000 1.1 +++ include/ieeefp.h 25 Oct 2003 17:52:19 -0000 @@ -1,3 +1,4 @@ +/* Copyright (C) 2003 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ #ifndef __dj_include_ieeefp_h_ #define __dj_include_ieeefp_h_ @@ -48,8 +49,6 @@ typedef int fp_rdi; fp_rdi _EXFUN(fpgetroundtoi,(void)); fp_rdi _EXFUN(fpsetroundtoi,(fp_rdi)); -int _EXFUN(isnan, (double)); -int _EXFUN(isinf, (double)); int _EXFUN(finite, (double)); int _EXFUN(isnanf, (float));