mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-27 06:10:06 +08:00
tccgen.c: use correct type for storing long double constants
This commit is contained in:
parent
3dfee1d290
commit
c09b6ce975
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;
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user