From d6bd135f329037b537dfe0e88fd20402a6b5a754 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Fri, 17 Feb 2006 01:13:38 +0000 Subject: [PATCH] re PR bootstrap/16787 (NAN constant "(0.0/0.0)" cannot be compiled by Tru64 cc) 2006-02-16 Roger Sayle R. Scott Bailey Bill Northcott PR bootstrap/16787 * floatformat.c: Include where available. (NAN): Use value of DBL_QNAN if defined, and NAN isn't. Co-Authored-By: Bill Northcott Co-Authored-By: R. Scott Bailey From-SVN: r111172 --- libiberty/ChangeLog | 8 ++++++++ libiberty/floatformat.c | 12 +++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index f0b0cec5e20e..b08419e44482 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,11 @@ +2006-02-16 Roger Sayle + R. Scott Bailey + Bill Northcott + + PR bootstrap/16787 + * floatformat.c: Include where available. + (NAN): Use value of DBL_QNAN if defined, and NAN isn't. + 2006-02-06 Kaveh R. Ghazi Backport: diff --git a/libiberty/floatformat.c b/libiberty/floatformat.c index a0f65354e482..273edd750a9b 100644 --- a/libiberty/floatformat.c +++ b/libiberty/floatformat.c @@ -1,5 +1,6 @@ /* IEEE floating point support routines, for GDB, the GNU Debugger. - Copyright (C) 1991, 1994, 1999, 2000, 2003 Free Software Foundation, Inc. + Copyright (C) 1991, 1994, 1999, 2000, 2003, 2006 + Free Software Foundation, Inc. This file is part of GDB. @@ -30,6 +31,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #endif +/* On some platforms, provides DBL_QNAN. */ +#ifdef STDC_HEADERS +#include +#endif + #include "ansidecl.h" #include "libiberty.h" #include "floatformat.h" @@ -43,8 +49,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #endif #ifndef NAN +#ifdef DBL_QNAN +#define NAN DBL_QNAN +#else #define NAN (0.0 / 0.0) #endif +#endif static unsigned long get_field PARAMS ((const unsigned char *, enum floatformat_byteorders, -- 2.47.2