From 12c61ac390c354de8dc9c872fdb25f38207ecc5c Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Sat, 11 Feb 2006 16:50:41 +0000 Subject: [PATCH] re PR bootstrap/16787 (NAN constant "(0.0/0.0)" cannot be compiled by Tru64 cc) 2006-02-11 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: r110873 --- libiberty/ChangeLog | 8 ++++++++ libiberty/floatformat.c | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index df72f6df029..e319e76b52d 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,11 @@ +2006-02-11 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-01-29 Gabriel Dos Reis * configure.ac: Add -Wc++-compat to ac_libibety_warn_cflags where diff --git a/libiberty/floatformat.c b/libiberty/floatformat.c index c97b6c57f0a..bd31efac7c1 100644 --- a/libiberty/floatformat.c +++ b/libiberty/floatformat.c @@ -1,5 +1,5 @@ /* IEEE floating point support routines, for GDB, the GNU Debugger. - Copyright 1991, 1994, 1999, 2000, 2003, 2005 + Copyright 1991, 1994, 1999, 2000, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GDB. @@ -31,6 +31,11 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #include #endif +/* On some platforms, provides DBL_QNAN. */ +#ifdef STDC_HEADERS +#include +#endif + #include "ansidecl.h" #include "libiberty.h" #include "floatformat.h" @@ -44,8 +49,12 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, 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 (const unsigned char *, enum floatformat_byteorders,