This takes care of case-insensitive filenames (like on win32)
Unified · Split
| @@ -99,7 +99,7 @@ static void help(void) · 98 unmodified lines | ||
| 99 | 99 | " -Usym undefine 'sym'\n" |
| 100 | 100 | " -E preprocess only\n" |
| 101 | 101 | " -P[1] no/alternative output of #line directives with -E\n" |
| 102 | − " -dD -dM dump defines (only with -E)\n" | |
| 102 | + " -d{D|M} dump defines (only with -E)\n" | |
| 103 | 103 | "Linker options:\n" |
| 104 | 104 | " -Ldir add library path 'dir'\n" |
| 105 | 105 | " -llib link with dynamic or static library 'lib'\n" |
| @@ -1444,6 +1444,8 @@ static inline void add_cached_include(TCCState *s1, const char *filename, int if · 1443 unmodified lines | ||
| 1444 | 1444 | s1->cached_includes_hash[h] = s1->nb_cached_includes; |
| 1445 | 1445 | } |
| 1446 | 1446 | |
| 1447 | +#define ONCE_PREFIX "#ONCE#" | |
| 1448 | + | |
| 1447 | 1449 | static void pragma_parse(TCCState *s1) |
| 1448 | 1450 | { |
| 1449 | 1451 | next_nomacro(); |
| @@ -1475,10 +1477,12 @@ static void pragma_parse(TCCState *s1) · 25 unmodified lines | ||
| 1475 | 1477 | tcc_warning("unbalanced #pragma pop_macro"); |
| 1476 | 1478 | |
| 1477 | 1479 | } else if (tok == TOK_once) { |
| 1478 | − char buf1[sizeof file->filename]; | |
| 1479 | − | |
| 1480 | − pstrcpy(buf1, sizeof(buf1), "#once#"); | |
| 1481 | − pstrcat(buf1, sizeof(buf1), file->filename); | |
| 1480 | + char buf1[sizeof(file->filename) + sizeof(ONCE_PREFIX)]; | |
| 1481 | + strcpy(buf1, ONCE_PREFIX); | |
| 1482 | + strcat(buf1, file->filename); | |
| 1483 | +#if PATHCMP==stricmp | |
| 1484 | + strupr(buf1); | |
| 1485 | +#endif | |
| 1482 | 1486 | add_cached_include(s1, file->filename, tok_alloc(buf1, strlen(buf1))->tok); |
| 1483 | 1487 | } else if (s1->ppfp) { |
| 1484 | 1488 | /* tcc -E: keep pragmas below unchanged */ |