From: Michael Beck Date: Sun, 14 Sep 2008 15:30:43 +0000 (+0000) Subject: - Ugly fix: MSVC runtime does not support long double printing, cast to double yet X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=67376adac7ca7957f9dd0cc33956d647e1e61000;p=cparser - Ugly fix: MSVC runtime does not support long double printing, cast to double yet [r21942] --- diff --git a/ast.c b/ast.c index 8452b12..060aa6c 100644 --- 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 {