mirror of
https://github.com/mirror/tinycc.git
synced 2024-12-26 03:50:07 +08:00
win32: treat long double as double
This commit is contained in:
parent
97738d1ae9
commit
9fda4f4248
6
tccgen.c
6
tccgen.c
@ -2527,7 +2527,9 @@ static int parse_btype(CType *type, AttributeDef *ad)
|
||||
case TOK_LONG:
|
||||
next();
|
||||
if ((t & VT_BTYPE) == VT_DOUBLE) {
|
||||
#ifndef TCC_TARGET_PE
|
||||
t = (t & ~VT_BTYPE) | VT_LDOUBLE;
|
||||
#endif
|
||||
} else if ((t & VT_BTYPE) == VT_LONG) {
|
||||
t = (t & ~VT_BTYPE) | VT_LLONG;
|
||||
} else {
|
||||
@ -2544,7 +2546,11 @@ static int parse_btype(CType *type, AttributeDef *ad)
|
||||
case TOK_DOUBLE:
|
||||
next();
|
||||
if ((t & VT_BTYPE) == VT_LONG) {
|
||||
#ifdef TCC_TARGET_PE
|
||||
t = (t & ~VT_BTYPE) | VT_DOUBLE;
|
||||
#else
|
||||
t = (t & ~VT_BTYPE) | VT_LDOUBLE;
|
||||
#endif
|
||||
} else {
|
||||
u = VT_DOUBLE;
|
||||
goto basic_type1;
|
||||
|
10
tccpp.c
10
tccpp.c
@ -1743,9 +1743,14 @@ void parse_number(const char *p)
|
||||
tokc.f = (float)d;
|
||||
} else if (t == 'L') {
|
||||
ch = *p++;
|
||||
#ifdef TCC_TARGET_PE
|
||||
tok = TOK_CDOUBLE;
|
||||
tokc.d = d;
|
||||
#else
|
||||
tok = TOK_CLDOUBLE;
|
||||
/* XXX: not large enough */
|
||||
tokc.ld = (long double)d;
|
||||
#endif
|
||||
} else {
|
||||
tok = TOK_CDOUBLE;
|
||||
tokc.d = d;
|
||||
@ -1794,8 +1799,13 @@ void parse_number(const char *p)
|
||||
tokc.f = strtof(token_buf, NULL);
|
||||
} else if (t == 'L') {
|
||||
ch = *p++;
|
||||
#ifdef TCC_TARGET_PE
|
||||
tok = TOK_CDOUBLE;
|
||||
tokc.d = strtod(token_buf, NULL);
|
||||
#else
|
||||
tok = TOK_CLDOUBLE;
|
||||
tokc.ld = strtold(token_buf, NULL);
|
||||
#endif
|
||||
} else {
|
||||
tok = TOK_CDOUBLE;
|
||||
tokc.d = strtod(token_buf, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user