| @@ -542,11 +542,7 @@ ST_FUNC const char *get_tok_str(int v, CValue *cv) · 541 unmodified lines |
| 542 | case TOK_CLLONG: | 542 | case TOK_CLLONG: |
| 543 | case TOK_CULLONG: | 543 | case TOK_CULLONG: |
| 544 | /* XXX: not quite exact, but only useful for testing */ | 544 | /* XXX: not quite exact, but only useful for testing */ |
| 545 | #ifdef _WIN32 | | |
| 546 | sprintf(p, "%u", (unsigned)cv->i); | | |
| 547 | #else | | |
| 548 | sprintf(p, "%llu", (unsigned long long)cv->i); | 545 | sprintf(p, "%llu", (unsigned long long)cv->i); |
| 549 | #endif | | |
| 550 | break; | 546 | break; |
| 551 | case TOK_LCHAR: | 547 | case TOK_LCHAR: |
| 552 | cstr_ccat(&cstr_buf, 'L'); | 548 | cstr_ccat(&cstr_buf, 'L'); |
| @@ -1493,8 +1489,7 @@ static int expr_preprocess(TCCState *s1) · 940 unmodified lines |
| 1493 | if (tok != ')') | 1489 | if (tok != ')') |
| 1494 | expect("')'"); | 1490 | expect("')'"); |
| 1495 | } | 1491 | } |
| 1496 | tok = TOK_CINT; | 1492 | goto c_number; |
| 1497 | tokc.i = c; | | |
| 1498 | } else if (tok == TOK___HAS_INCLUDE || | 1493 | } else if (tok == TOK___HAS_INCLUDE || |
| 1499 | tok == TOK___HAS_INCLUDE_NEXT) { | 1494 | tok == TOK___HAS_INCLUDE_NEXT) { |
| 1500 | t = tok; | 1495 | t = tok; |
| @@ -1504,12 +1499,13 @@ static int expr_preprocess(TCCState *s1) · 3 unmodified lines |
| 1504 | c = parse_include(s1, t - TOK___HAS_INCLUDE, 1); | 1499 | c = parse_include(s1, t - TOK___HAS_INCLUDE, 1); |
| 1505 | if (tok != ')') | 1500 | if (tok != ')') |
| 1506 | expect("')'"); | 1501 | expect("')'"); |
| 1507 | tok = TOK_CINT; | 1502 | goto c_number; |
| 1508 | tokc.i = c; | | |
| 1509 | } else { | 1503 | } else { |
| 1510 | /* if undefined macro, replace with zero */ | 1504 | /* if undefined macro, replace with zero */ |
| 1511 | tok = TOK_CINT; | 1505 | c = 0; |
| 1512 | tokc.i = 0; | 1506 | c_number: |
| | 1507 | tok = TOK_CLLONG; /* type intmax_t */ |
| | 1508 | tokc.i = c; |
| 1513 | } | 1509 | } |
| 1514 | tok_str_add_tok(str); | 1510 | tok_str_add_tok(str); |
| 1515 | } | 1511 | } |
| @@ -2510,6 +2506,10 @@ static void parse_number(const char *p) · 994 unmodified lines |
| 2510 | } | 2506 | } |
| 2511 | } | 2507 | } |
| 2512 | | 2508 | |
| | 2509 | /* in #if/#elif expressions, all numbers have type (u)intmax_t anyway */ |
| | 2510 | if (pp_expr) |
| | 2511 | lcount = 2; |
| | 2512 | |
| 2513 | /* Determine if it needs 64 bits and/or unsigned in order to fit */ | 2513 | /* Determine if it needs 64 bits and/or unsigned in order to fit */ |
| 2514 | if (ucount == 0 && b == 10) { | 2514 | if (ucount == 0 && b == 10) { |
| 2515 | if (lcount <= (LONG_SIZE == 4)) { | 2515 | if (lcount <= (LONG_SIZE == 4)) { |