X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f Sender: rich AT phekda DOT freeserve DOT co DOT uk Message-ID: <3F9BB1FE.43B877E9@phekda.freeserve.co.uk> Date: Sun, 26 Oct 2003 11:37:34 +0000 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: Clash between math.h and ieeefp.h [PATCH] References: <9743-Sat25Oct2003233921+0200-eliz AT elta DOT co DOT il> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Hello. Eli Zaretskii wrote: > > > Date: Sat, 25 Oct 2003 20:16:28 +0100 > > From: "Richard Dawe" > > > > 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. > > 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