aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2006-02-16 16:45:49 +0000
committerRoger Sayle <roger@eyesopen.com>2006-02-16 16:45:49 +0000
commit612dc2a198e87e93b8604ca344bb5702b0bfebaf (patch)
tree3b87f8396c28ce759bfabd47d1ce234ee7313f25
parent11cf27f4c12dfb4b7b064660b1de37a753623e47 (diff)
2006-02-16 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. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_1-branch@111145 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libiberty/ChangeLog8
-rw-r--r--libiberty/floatformat.c11
2 files changed, 18 insertions, 1 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 6fdeba3e852..6b9702ec35b 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,11 @@
+2006-02-16 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.
+
2005-11-06 Richard Guenther <rguenther@suse.de>
* splay-tree.c (rotate_left): New function.
diff --git a/libiberty/floatformat.c b/libiberty/floatformat.c
index 28c9fbf662d..75027a01d43 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,