re PR bootstrap/16787 (NAN constant "(0.0/0.0)" cannot be compiled by Tru64 cc)
authorRoger Sayle <roger@eyesopen.com>
Sat, 11 Feb 2006 16:50:41 +0000 (16:50 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sat, 11 Feb 2006 16:50:41 +0000 (16:50 +0000)
2006-02-11  Roger Sayle  <roger@eyesopen.com>
    R. Scott Bailey  <scott.bailey@eds.com>
    Bill Northcott  <w.northcott@unsw.edu.au>

PR bootstrap/16787
* floatformat.c: Include <float.h> where available.
(NAN): Use value of DBL_QNAN if defined, and NAN isn't.

Co-Authored-By: Bill Northcott <w.northcott@unsw.edu.au>
Co-Authored-By: R. Scott Bailey <scott.bailey@eds.com>
From-SVN: r110873

libiberty/ChangeLog
libiberty/floatformat.c

index df72f6df029966974f505705ebc4ec158915886d..e319e76b52df674fc09950a27bb2dca3df62ff0e 100644 (file)
@@ -1,3 +1,11 @@
+2006-02-11  Roger Sayle  <roger@eyesopen.com>
+           R. Scott Bailey  <scott.bailey@eds.com>
+           Bill Northcott  <w.northcott@unsw.edu.au>
+
+       PR bootstrap/16787
+       * floatformat.c: Include <float.h> where available.
+       (NAN): Use value of DBL_QNAN if defined, and NAN isn't.
+
 2006-01-29  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        * configure.ac: Add -Wc++-compat to ac_libibety_warn_cflags where
index c97b6c57f0aeb768170039bccf67afaeea72c387..bd31efac7c17bd5c260a73a2618f2a7bbee2d4d7 100644 (file)
@@ -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 <string.h>
 #endif
 
+/* On some platforms, <float.h> provides DBL_QNAN.  */
+#ifdef STDC_HEADERS
+#include <float.h>
+#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,