summaryrefslogtreecommitdiff
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
commita37c9caee8309853750295de513544d8298ccbc3 (patch)
tree174e0505fa3193f6f1d7c0dcb27cf325701c417d /gdb/doublest.h
parentf420e9d42b00cb209e6ca3e9f4b13379451490a3 (diff)
downloadgdb-a37c9caee8309853750295de513544d8298ccbc3.tar.gz
* 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 c10b3ea9c0b..1a479b86719 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 *,