| @@ -3465,6 +3465,7 @@ ST_INLN void unget_tok(int last_tok) · 3464 unmodified lines |
| 3465 | | 3465 | |
| 3466 | ST_FUNC void preprocess_start(TCCState *s1) | 3466 | ST_FUNC void preprocess_start(TCCState *s1) |
| 3467 | { | 3467 | { |
| | 3468 | char *buf; |
| 3468 | s1->include_stack_ptr = s1->include_stack; | 3469 | s1->include_stack_ptr = s1->include_stack; |
| 3469 | /* XXX: move that before to avoid having to initialize | 3470 | /* XXX: move that before to avoid having to initialize |
| 3470 | file->ifdef_stack_ptr ? */ | 3471 | file->ifdef_stack_ptr ? */ |
| @@ -3480,6 +3481,11 @@ ST_FUNC void preprocess_start(TCCState *s1) · 9 unmodified lines |
| 3480 | s1->dollars_in_identifiers ? IS_ID : 0; | 3481 | s1->dollars_in_identifiers ? IS_ID : 0; |
| 3481 | isidnum_table['.' - CH_EOF] = | 3482 | isidnum_table['.' - CH_EOF] = |
| 3482 | (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0; | 3483 | (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0; |
| | 3484 | buf = tcc_malloc(3 + strlen(file->filename)); |
| | 3485 | sprintf(buf, "\"%s\"", file->filename); |
| | 3486 | tcc_undefine_symbol(s1, "__BASE_FILE__"); |
| | 3487 | tcc_define_symbol(s1, "__BASE_FILE__", buf); |
| | 3488 | tcc_free(buf); |
| 3483 | if (s1->nb_cmd_include_files) { | 3489 | if (s1->nb_cmd_include_files) { |
| 3484 | CString cstr; | 3490 | CString cstr; |
| 3485 | int i; | 3491 | int i; |