aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tccgen.c b/tccgen.c
index c33cc81..bb10fe6 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -5538,7 +5538,12 @@ static void init_putv(CType *type, Section *sec, unsigned long c,
*(double *)ptr = vtop->c.d;
break;
case VT_LDOUBLE:
- *(long double *)ptr = vtop->c.ld;
+ if (sizeof(long double) == LDOUBLE_SIZE)
+ *(long double *)ptr = vtop->c.ld;
+ else if (sizeof(double) == LDOUBLE_SIZE)
+ *(double *)ptr = vtop->c.ld;
+ else
+ tcc_error("can't cross compile long double constants");
break;
case VT_LLONG:
*(long long *)ptr |= (vtop->c.i & bit_mask) << bit_pos;