summaryrefslogtreecommitdiff
path: root/cgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgen.c')
-rw-r--r--cgen.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cgen.c b/cgen.c
index 75d3803..ab65f30 100644
--- a/cgen.c
+++ b/cgen.c
@@ -1326,6 +1326,11 @@ static void cgen_expr(CGenerator *g, Expression *e) {
cgen_write(g, "%.16Lf", (long double)e->floatl);
break;
case EXPR_LITERAL_INT:
+ /* make sure it's the right type (for variadic foreign functions) */
+ cgen_write(g, "(");
+ cgen_type_pre(g, &e->type);
+ cgen_type_post(g, &e->type);
+ cgen_write(g, ")");
cgen_write(g, U64_FMT, e->intl);
break;
case EXPR_LITERAL_STR: {