mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-15 05:20:06 +08:00
7b9f19eaab
- 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
42 lines
497 B
C
42 lines
497 B
C
/* accept 'defined' as result of substitution */
|
|
|
|
----- 1 ------
|
|
#define AAA 2
|
|
#define BBB
|
|
#define CCC (defined ( AAA ) && AAA > 1 && !defined BBB)
|
|
#if !CCC
|
|
OK
|
|
#else
|
|
NOT OK
|
|
#endif
|
|
|
|
----- 2 ------
|
|
#undef BBB
|
|
#if CCC
|
|
OK
|
|
#else
|
|
NOT OK
|
|
#endif
|
|
|
|
----- 3 ------
|
|
#define DEFINED defined
|
|
#define DDD (DEFINED ( AAA ) && AAA > 1 && !DEFINED BBB)
|
|
#if (DDD)
|
|
OK
|
|
#else
|
|
NOT OK
|
|
#endif
|
|
|
|
----- 4 ------
|
|
#undef AAA
|
|
#if !(DDD)
|
|
OK
|
|
#else
|
|
NOT OK
|
|
#endif
|
|
|
|
----- 5 ------
|
|
line __LINE__
|
|
#define __LINE__ # ## #
|
|
line __LINE__
|