tccgen.c: use correct type for storing long double constants
This commit is contained in:
parent
3dfee1d290
commit
c09b6ce975
1 changed files with 6 additions and 1 deletions
7
tccgen.c
7
tccgen.c
|
@ -5538,7 +5538,12 @@ static void init_putv(CType *type, Section *sec, unsigned long c,
|
||||||
*(double *)ptr = vtop->c.d;
|
*(double *)ptr = vtop->c.d;
|
||||||
break;
|
break;
|
||||||
case VT_LDOUBLE:
|
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;
|
break;
|
||||||
case VT_LLONG:
|
case VT_LLONG:
|
||||||
*(long long *)ptr |= (vtop->c.i & bit_mask) << bit_pos;
|
*(long long *)ptr |= (vtop->c.i & bit_mask) << bit_pos;
|
||||||
|
|
Loading…
Add table
Reference in a new issue