aboutsummaryrefslogtreecommitdiff
path: root/libiberty/floatformat.c
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-16 20:15:10 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-16 20:15:10 +0000
commit4fe41d20e2dc51a6934f3ebd64539b7c4c8841ac (patch)
tree2aa1da3dc4fc68fef3858bc4168bdaeb05ec25b9 /libiberty/floatformat.c
parent40c08f690c77eeeb74fcc4feab083e2fa78a8ff0 (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: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_0-branch@111147 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/floatformat.c')
-rw-r--r--libiberty/floatformat.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libiberty/floatformat.c b/libiberty/floatformat.c
index a0f65354e48..273edd750a9 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 <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"
@@ -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,