aboutsummaryrefslogtreecommitdiff
path: root/gdb/doublest.h
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2006-02-14 18:45:14 +0000
committerAlexandre Oliva <aoliva@redhat.com>2006-02-14 18:45:14 +0000
commit96c1eda247c7846f4bbd32d65db6819baefad08b (patch)
tree9bc74063c6c31a5947f17bf6da9c2b5c54d76434 /gdb/doublest.h
parent92dd43fa3bc92e0a97408eaa406143c41460581c (diff)
downloadfsf-binutils-gdb-96c1eda247c7846f4bbd32d65db6819baefad08b.zip
fsf-binutils-gdb-96c1eda247c7846f4bbd32d65db6819baefad08b.tar.gz
fsf-binutils-gdb-96c1eda247c7846f4bbd32d65db6819baefad08b.tar.bz2
* doublest.h (DOUBLEST): Use long double only if we can scan
it in. Undefine HAVE_LONG_DOUBLE otherwise. (DOUBLEST_FORMAT): New. * c-exp.y (parse_number): Use it. * jv-exp.y (parse_number): Likewise. * objc-exp.y (parse_number): Likewise. * p-exp.y (parse_number): Likewise. * varobj.c (free_variable): Silence type-punning warnings. * tui/tui-data.h (struct tui_list): Change type of list member. * tui/tui-data.c: Remove no-longer-needed type casts. (source_windows): Silence type-punning warnings. * tui/tui-stack.c, tui/tui-win.c, tui/tui-winsource.c: Likewise.
Diffstat (limited to 'gdb/doublest.h')
-rw-r--r--gdb/doublest.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/doublest.h b/gdb/doublest.h
index c10b3ea..1a479b8 100644
--- a/gdb/doublest.h
+++ b/gdb/doublest.h
@@ -48,10 +48,15 @@ struct floatformat;
host's `long double'. In general, we'll probably reduce the precision of
any such values and print a warning. */
-#ifdef HAVE_LONG_DOUBLE
+#if defined HAVE_LONG_DOUBLE && defined SCANF_HAS_LONG_DOUBLE
typedef long double DOUBLEST;
+# define DOUBLEST_FORMAT "%Lg"
#else
typedef double DOUBLEST;
+# define DOUBLEST_FORMAT "%g"
+/* If we can't scan or print long double, we don't want to use it
+ anywhere. */
+# undef HAVE_LONG_DOUBLE
#endif
extern void floatformat_to_doublest (const struct floatformat *,