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
2527 case TOK_LONG:2527 case TOK_LONG:
2528 next();2528 next();
2529 if ((t & VT_BTYPE) == VT_DOUBLE) {2529 if ((t & VT_BTYPE) == VT_DOUBLE) {
2530#ifndef TCC_TARGET_PE
2530 t = (t & ~VT_BTYPE) | VT_LDOUBLE;2531 t = (t & ~VT_BTYPE) | VT_LDOUBLE;
2532#endif
2531 } else if ((t & VT_BTYPE) == VT_LONG) {2533 } else if ((t & VT_BTYPE) == VT_LONG) {
2532 t = (t & ~VT_BTYPE) | VT_LLONG;2534 t = (t & ~VT_BTYPE) | VT_LLONG;
2533 } else {2535 } else {
@@ -2544,7 +2546,11 @@ static int parse_btype(CType *type, AttributeDef *ad) · 10 unmodified lines
2544 case TOK_DOUBLE:2546 case TOK_DOUBLE:
2545 next();2547 next();
2546 if ((t & VT_BTYPE) == VT_LONG) {2548 if ((t & VT_BTYPE) == VT_LONG) {
2549#ifdef TCC_TARGET_PE
2550 t = (t & ~VT_BTYPE) | VT_DOUBLE;
2551#else
2547 t = (t & ~VT_BTYPE) | VT_LDOUBLE;2552 t = (t & ~VT_BTYPE) | VT_LDOUBLE;
2553#endif
2548 } else {2554 } else {
2549 u = VT_DOUBLE;2555 u = VT_DOUBLE;
2550 goto basic_type1;2556 goto basic_type1;
tccpp.c+10−0
@@ -1743,9 +1743,14 @@ void parse_number(const char *p) · 1742 unmodified lines
1743 tokc.f = (float)d;1743 tokc.f = (float)d;
1744 } else if (t == 'L') {1744 } else if (t == 'L') {
1745 ch = *p++;1745 ch = *p++;
1746#ifdef TCC_TARGET_PE
1747 tok = TOK_CDOUBLE;
1748 tokc.d = d;
1749#else
1746 tok = TOK_CLDOUBLE;1750 tok = TOK_CLDOUBLE;
1747 /* XXX: not large enough */1751 /* XXX: not large enough */
1748 tokc.ld = (long double)d;1752 tokc.ld = (long double)d;
1753#endif
1749 } else {1754 } else {
1750 tok = TOK_CDOUBLE;1755 tok = TOK_CDOUBLE;
1751 tokc.d = d;1756 tokc.d = d;
@@ -1794,8 +1799,13 @@ void parse_number(const char *p) · 42 unmodified lines
1794 tokc.f = strtof(token_buf, NULL);1799 tokc.f = strtof(token_buf, NULL);
1795 } else if (t == 'L') {1800 } else if (t == 'L') {
1796 ch = *p++;1801 ch = *p++;
1802#ifdef TCC_TARGET_PE
1803 tok = TOK_CDOUBLE;
1804 tokc.d = strtod(token_buf, NULL);
1805#else
1797 tok = TOK_CLDOUBLE;1806 tok = TOK_CLDOUBLE;
1798 tokc.ld = strtold(token_buf, NULL);1807 tokc.ld = strtold(token_buf, NULL);
1808#endif
1799 } else {1809 } else {
1800 tok = TOK_CDOUBLE;1810 tok = TOK_CDOUBLE;
1801 tokc.d = strtod(token_buf, NULL);1811 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