tccpp: macro cleanup
commit7b9f19eaab7e568a7c7a42725da812377a588f50
authorgrischka <grischka>
Fri, 9 Feb 2024 15:07:43 +0000 (9 16:07 +0100)
committergrischka <grischka>
Fri, 9 Feb 2024 17:38:14 +0000 (9 18:38 +0100)
tree2593079d07c66ec6b663efabfb1fa66618aec326
parentb671fc0594625eb5ac147ec83be6d0c1fc1a6ad5
tccpp: macro cleanup

- remove TOK_NOSUBST, mark the token itself instead
- get_tok_str(); mask out SYM_FIELD & update uses
- next(): optimize (~5% faster with tcc -E)
- tok_flags: remove some redundancy
- parse_define(): do not remove spaces around '##' and after '#'
    and mark macros with '##' as MACRO_JOIN to avoid unnecessary
    call to macro_twosharps(mstr):
- next_nomacro(): removed, next_nomacro1(): renamed to next_nomacro()
- next_argstream(): cleanup & new function peek_file()
- macro_subst_tok(): handle special macros (__DATE__ etc.)
  like normal macros if they are #defined
- -DPP_DEBUG : more structured output
- pp_error(): better preprocessor expression error message
- tcctok.h: sort basic keywords (somehow)
- testspp/Makefile: generate .expect with 'make testspp.##+'
- tcc.c: tcc -E -o file : put unixy LFs also on windows
15 files changed:
libtcc.c
tcc.c
tcc.h
tccasm.c
tccdbg.c
tccgen.c
tccpp.c
tcctok.h
tests/pp/11.c
tests/pp/11.expect
tests/pp/21.c
tests/pp/21.expect
tests/pp/Makefile
tests/tests2/60_errors_and_warnings.c
tests/tests2/60_errors_and_warnings.expect