summaryrefslogtreecommitdiff
path: root/gdb/doublest.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/doublest.h')
-rw-r--r--gdb/doublest.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/doublest.h b/gdb/doublest.h
index a035b7d79d0..1ebefd81308 100644
--- a/gdb/doublest.h
+++ b/gdb/doublest.h
@@ -48,15 +48,20 @@ struct floatformat;
host's `long double'. In general, we'll probably reduce the precision of
any such values and print a warning. */
-#if defined HAVE_LONG_DOUBLE && defined SCANF_HAS_LONG_DOUBLE
+#if (defined HAVE_LONG_DOUBLE && defined PRINTF_HAS_LONG_DOUBLE \
+ && defined SCANF_HAS_LONG_DOUBLE)
typedef long double DOUBLEST;
-# define DOUBLEST_FORMAT "%Lg"
+# define DOUBLEST_PRINT_FORMAT "%Lg"
+# define DOUBLEST_SCAN_FORMAT "%Lg"
#else
typedef double DOUBLEST;
-# define DOUBLEST_FORMAT "%g"
+# define DOUBLEST_PRINT_FORMAT "%g"
+# define DOUBLEST_SCAN_FORMAT "%lg"
/* If we can't scan or print long double, we don't want to use it
anywhere. */
# undef HAVE_LONG_DOUBLE
+# undef PRINTF_HAS_LONG_DOUBLE
+# undef SCANF_HAS_LONG_DOUBLE
#endif
extern void floatformat_to_doublest (const struct floatformat *,