History

win32: treat long double as double

grischka committed 17 years ago

Commit 9fda4f41 parent 97738d12 files · +16 −0Browse files

Unified · Split

2 files
  1. tccgen.c +6 −0
  2. tccpp.c +10 −0
tccgen.c+6−0
@@ -2527,7 +2527,9 @@ static int parse_btype(CType *type, AttributeDef *ad) · 2526 unmodified lines
25272527 case TOK_LONG:
25282528 next();
25292529 if ((t & VT_BTYPE) == VT_DOUBLE) {
2530+#ifndef TCC_TARGET_PE
25302531 t = (t & ~VT_BTYPE) | VT_LDOUBLE;
2532+#endif
25312533 } else if ((t & VT_BTYPE) == VT_LONG) {
25322534 t = (t & ~VT_BTYPE) | VT_LLONG;
25332535 } else {
@@ -2544,7 +2546,11 @@ static int parse_btype(CType *type, AttributeDef *ad) · 10 unmodified lines
25442546 case TOK_DOUBLE:
25452547 next();
25462548 if ((t & VT_BTYPE) == VT_LONG) {
2549+#ifdef TCC_TARGET_PE
2550+ t = (t & ~VT_BTYPE) | VT_DOUBLE;
2551+#else
25472552 t = (t & ~VT_BTYPE) | VT_LDOUBLE;
2553+#endif
25482554 } else {
25492555 u = VT_DOUBLE;
25502556 goto basic_type1;
tccpp.c+10−0
@@ -1743,9 +1743,14 @@ void parse_number(const char *p) · 1742 unmodified lines
17431743 tokc.f = (float)d;
17441744 } else if (t == 'L') {
17451745 ch = *p++;
1746+#ifdef TCC_TARGET_PE
1747+ tok = TOK_CDOUBLE;
1748+ tokc.d = d;
1749+#else
17461750 tok = TOK_CLDOUBLE;
17471751 /* XXX: not large enough */
17481752 tokc.ld = (long double)d;
1753+#endif
17491754 } else {
17501755 tok = TOK_CDOUBLE;
17511756 tokc.d = d;
@@ -1794,8 +1799,13 @@ void parse_number(const char *p) · 42 unmodified lines
17941799 tokc.f = strtof(token_buf, NULL);
17951800 } else if (t == 'L') {
17961801 ch = *p++;
1802+#ifdef TCC_TARGET_PE
1803+ tok = TOK_CDOUBLE;
1804+ tokc.d = strtod(token_buf, NULL);
1805+#else
17971806 tok = TOK_CLDOUBLE;
17981807 tokc.ld = strtold(token_buf, NULL);
1808+#endif
17991809 } else {
18001810 tok = TOK_CDOUBLE;
18011811 tokc.d = strtod(token_buf, NULL);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t