aboutsummaryrefslogtreecommitdiff
path: root/libiberty/floatformat.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2006-02-12 15:54:25 +0000
committerDJ Delorie <dj@redhat.com>2006-02-12 15:54:25 +0000
commite27d251e327de665b6f3284557acb8c8176e4375 (patch)
treefaee9c8ea42c2e715d15b04aaa3579e96548ff36 /libiberty/floatformat.c
parent3b24bd49b51996525ab189bd879ba7728b285a6d (diff)
downloadgdb-e27d251e327de665b6f3284557acb8c8176e4375.zip
gdb-e27d251e327de665b6f3284557acb8c8176e4375.tar.gz
gdb-e27d251e327de665b6f3284557acb8c8176e4375.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/floatformat.c')
-rw-r--r--libiberty/floatformat.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libiberty/floatformat.c b/libiberty/floatformat.c
index c97b6c5..bd31efa 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 <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,