提交 0378168c 编辑于 作者: herman ten brugge's avatar herman ten brugge
浏览文件

Fix macro processing

The code:

printf("%d\n", CALL(CONST));

did not work because we did not check for TOK_PLCHLDR.
上级 3564c47e
......@@ -3424,7 +3424,8 @@ static int macro_subst_tok(
for(;;) {
do {
next_argstream(nested_list, NULL);
} while (is_space(tok) || TOK_LINEFEED == tok);
} while (tok == TOK_PLCHLDR || is_space(tok) ||
TOK_LINEFEED == tok);
empty_arg:
/* handle '()' case */
if (!args && !sa && tok == ')')
......
......@@ -115,6 +115,9 @@ static int onetwothree = 123;
#define MACRO_NOARGS()
#define TEST_CALL(f, ...) f(__VA_ARGS__)
#define TEST_CONST() 123
#define AAA 3
#undef AAA
#define AAA 4
......@@ -223,6 +226,8 @@ void macro_test(void)
MACRO_NOARGS();
printf("%d\n", TEST_CALL(TEST_CONST));
/* not strictly preprocessor, but we test it there */
#ifdef C99_MACROS
printf("__func__ = %s\n", __func__);
......
Supports Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册