delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/10/25/15:52:51

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" <rich AT phekda DOT freeserve DOT co DOT uk>
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: <E1ADTj5-0001KS-00@phekda.freeserve.co.uk>
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 <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.

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));

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019