Skip to content
GitLab
菜单
项目
群组
代码片段
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录/注册
切换导航
菜单
打开侧边栏
Panda
TinyCC
提交
0378168c
提交
0378168c
编辑于
5月 04, 2021
作者:
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
变更
2
Hide whitespace changes
Inline
Side-by-side
tccpp.c
浏览文件 @
0378168c
...
...
@@ -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
==
')'
)
...
...
tests/tcctest.c
浏览文件 @
0378168c
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录