- Ugly fix: MSVC runtime does not support long double printing, cast to double yet
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sun, 14 Sep 2008 15:30:43 +0000 (15:30 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sun, 14 Sep 2008 15:30:43 +0000 (15:30 +0000)
[r21942]

ast.c

diff --git a/ast.c b/ast.c
index 8452b12..060aa6c 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -208,7 +208,12 @@ static void print_const(const const_expression_t *cnst)
                fprintf(out, "%lld", cnst->v.int_value);
        } else if (is_type_float(type)) {
                long double const val = cnst->v.float_value;
+#ifdef _WIN32
+               /* ARG, no way to print long double */
+               fprintf(out, "%.20g", (double)val);
+#else
                fprintf(out, "%.20Lg", val);
+#endif
                if (isfinite(val) && truncl(val) == val)
                        fputs(".0", out);
        } else {