mirror of
https://github.com/frida/tinycc
synced 2024-11-24 16:49:44 +03:00
fix end-of-scope for self-referential macros
This commit is contained in:
parent
f8656fbc3c
commit
d01f65ef93
2
tccpp.c
2
tccpp.c
@ -2689,6 +2689,8 @@ static int macro_subst_tok(TokenString *tok_str,
|
|||||||
ml->p = NULL;
|
ml->p = NULL;
|
||||||
*can_read_stream = ml -> prev;
|
*can_read_stream = ml -> prev;
|
||||||
}
|
}
|
||||||
|
/* also, end of scope for nested defined symbol */
|
||||||
|
(*nested_list)->v = -1;
|
||||||
goto redo;
|
goto redo;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -290,13 +290,12 @@ static void print_num(char *fn, int line, int num) {
|
|||||||
|
|
||||||
void recursive_macro_test(void)
|
void recursive_macro_test(void)
|
||||||
{
|
{
|
||||||
#if 0 /* doesnt work yet */
|
|
||||||
#define ELF32_ST_TYPE(val) ((val) & 0xf)
|
#define ELF32_ST_TYPE(val) ((val) & 0xf)
|
||||||
#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
|
#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
|
||||||
#define STB_WEAK 2 /* Weak symbol */
|
#define STB_WEAK 2 /* Weak symbol */
|
||||||
#define ELFW(type) ELF##32##_##type
|
#define ELFW(type) ELF##32##_##type
|
||||||
printf("%d\n", ELFW(ST_INFO)(STB_WEAK, ELFW(ST_TYPE)(123)));
|
printf("%d\n", ELFW(ST_INFO)(STB_WEAK, ELFW(ST_TYPE)(123)));
|
||||||
#endif
|
|
||||||
|
|
||||||
#define WRAP(x) x
|
#define WRAP(x) x
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user