feat(argparse): 添加列表类型参数支持
新增 scc_argparse_list_t 类型用于处理多个字符串值的参数, 并添加相应的配置函数 scc_argparse_spec_setup_list。 fix(lexer): 调整关键字标记处理逻辑 将关键字子类型从 SCC_TOK_SUBTYPE_KEYWORD 改为 SCC_TOK_SUBTYPE_IDENTIFIER,并移除相关的枚举定义。 refactor(lexer): 优化跳过换行功能实现 修改 scc_lexer_skip_until_newline 函数实现,改进循环逻辑和错误处理。 feat(pproc): 完善预处理器条件编译支持 重构条件编译状态管理,添加对 #ifdef、#ifndef、#elifdef、 #else、#endif 等指令的支持,并实现嵌套条件处理。 refactor(pproc): 优化文件包含路径处理 添加最大包含深度限制,改进包含路径添加功能, 修复文件状态结构命名。 docs(log): 更新日志模块标准库依赖 调整 stdarg.h 包含逻辑,更新编译器内置宏定义名称。 feat(core): 扩展核心类型定义 添加基础数据类型别名定义,完善类型系统支持。 feat(main): 实现命令行包含路径参数 添加 -I/--include 参数支持,允许用户指定额外的头文件搜索路径。
This commit is contained in:
@@ -15,18 +15,19 @@
|
||||
|
||||
// 条件编译状态栈
|
||||
typedef struct {
|
||||
int active; // 当前层级是否有效(即应该输出 token)
|
||||
int skip; // 当前层级是否跳过(即不输出 token)
|
||||
// 可根据需要增加状态,如 #if 的结果、#elif 已执行等
|
||||
} scc_pproc_if_state_t;
|
||||
typedef SCC_VEC(scc_pproc_if_state_t) scc_pproc_if_stack_t;
|
||||
cbool found_true;
|
||||
cbool seen_else;
|
||||
cbool active;
|
||||
} scc_pproc_if_t;
|
||||
typedef SCC_VEC(scc_pproc_if_t) scc_pproc_if_stack_t;
|
||||
|
||||
typedef struct {
|
||||
scc_sstream_t sstream;
|
||||
scc_lexer_t lexer;
|
||||
scc_lexer_tok_ring_t *ring;
|
||||
} scc_pproc_file_state_t;
|
||||
typedef SCC_VEC(scc_pproc_file_state_t *) scc_pproc_file_stack_t;
|
||||
} scc_pproc_file_t;
|
||||
typedef SCC_VEC(scc_pproc_file_t *) scc_pproc_file_stack_t;
|
||||
|
||||
typedef SCC_VEC(scc_lexer_tok_ring_t *) scc_pproc_ring_vec_t;
|
||||
typedef SCC_VEC(scc_cstring_t) scc_pproc_cstr_vec_t;
|
||||
|
||||
@@ -36,6 +37,7 @@ typedef struct scc_pproc {
|
||||
scc_lexer_tok_ring_t expanded_ring;
|
||||
scc_strpool_t strpool;
|
||||
int at_line_start;
|
||||
int enable;
|
||||
|
||||
scc_pproc_cstr_vec_t include_paths;
|
||||
scc_pproc_macro_table_t macro_table;
|
||||
@@ -44,12 +46,26 @@ typedef struct scc_pproc {
|
||||
|
||||
scc_lexer_tok_ring_t ring;
|
||||
int ring_ref_count;
|
||||
|
||||
struct {
|
||||
int max_include_depth;
|
||||
} config;
|
||||
} scc_pproc_t;
|
||||
|
||||
void scc_pproc_init(scc_pproc_t *pp, scc_lexer_tok_ring_t *input);
|
||||
scc_lexer_tok_ring_t *scc_pproc_to_ring(scc_pproc_t *pp, int ring_size);
|
||||
void scc_pproc_drop(scc_pproc_t *pp);
|
||||
|
||||
static inline void scc_pproc_add_include_path(scc_pproc_t *pp,
|
||||
const scc_cstring_t *path) {
|
||||
scc_vec_push(pp->include_paths, scc_cstring_copy(path));
|
||||
}
|
||||
|
||||
static inline void scc_pproc_add_include_path_cstr(scc_pproc_t *pp,
|
||||
const char *path) {
|
||||
scc_vec_push(pp->include_paths, scc_cstring_from_cstr(path));
|
||||
}
|
||||
|
||||
void scc_pproc_handle_directive(scc_pproc_t *pp);
|
||||
void scc_pproc_parse_include(scc_pproc_t *pp, scc_lexer_tok_t *include_tok);
|
||||
void scc_pproc_parse_macro_arguments(scc_lexer_tok_ring_t *ring,
|
||||
|
||||
@@ -208,10 +208,11 @@ void scc_pproc_handle_directive(scc_pproc_t *pp) {
|
||||
scc_lexer_tok_t tok = {0};
|
||||
int ok = 0;
|
||||
scc_ring_next(*pp->cur_ring, tok, ok);
|
||||
Assert(ok == true && tok.type == SCC_TOK_SHARP);
|
||||
scc_lexer_tok_drop(&tok);
|
||||
|
||||
if (!scc_lexer_next_non_blank(pp->cur_ring, &tok) ||
|
||||
tok.type != SCC_TOK_IDENT) {
|
||||
scc_get_tok_subtype(tok.type) != SCC_TOK_SUBTYPE_IDENTIFIER) {
|
||||
scc_lexer_tok_drop(&tok);
|
||||
LOG_ERROR("Invalid preprocessor directive");
|
||||
goto ERROR;
|
||||
@@ -223,8 +224,34 @@ void scc_pproc_handle_directive(scc_pproc_t *pp) {
|
||||
LOG_ERROR("Expected preprocessor keyword, got %s", tok.lexeme);
|
||||
goto ERROR;
|
||||
}
|
||||
|
||||
scc_tok_type_t type = keywords[ret].tok_type;
|
||||
|
||||
if (scc_vec_size(pp->if_stack) != 0) {
|
||||
scc_pproc_if_t *top =
|
||||
&scc_vec_at(pp->if_stack, scc_vec_size(pp->if_stack) - 1);
|
||||
pp->enable = top->active;
|
||||
}
|
||||
// 非条件指令,且当前不活动时直接跳过整行
|
||||
int is_conditional = 0;
|
||||
switch (type) {
|
||||
case SCC_PP_TOK_IFDEF:
|
||||
case SCC_PP_TOK_IFNDEF:
|
||||
case SCC_PP_TOK_ELIFDEF:
|
||||
case SCC_PP_TOK_ELIFNDEF:
|
||||
case SCC_PP_TOK_ELSE:
|
||||
case SCC_PP_TOK_ENDIF:
|
||||
case SCC_PP_TOK_IF:
|
||||
case SCC_PP_TOK_ELIF:
|
||||
is_conditional = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (!is_conditional && !pp->enable) {
|
||||
scc_lexer_skip_until_newline(pp->cur_ring);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case SCC_PP_TOK_DEFINE: {
|
||||
scc_lexer_tok_drop(&tok);
|
||||
@@ -273,15 +300,118 @@ void scc_pproc_handle_directive(scc_pproc_t *pp) {
|
||||
case SCC_PP_TOK_INCLUDE:
|
||||
scc_pproc_parse_include(pp, &tok);
|
||||
return;
|
||||
case SCC_PP_TOK_IF:
|
||||
case SCC_PP_TOK_IFDEF:
|
||||
case SCC_PP_TOK_IFNDEF:
|
||||
case SCC_PP_TOK_ELSE:
|
||||
case SCC_PP_TOK_ELIF:
|
||||
case SCC_PP_TOK_IFNDEF: {
|
||||
// 解析标识符
|
||||
if (!scc_lexer_next_non_blank(pp->cur_ring, &tok) ||
|
||||
tok.type != SCC_TOK_IDENT) {
|
||||
scc_lexer_tok_drop(&tok);
|
||||
LOG_ERROR("expected identifier");
|
||||
goto ERROR;
|
||||
}
|
||||
cbool defined =
|
||||
(scc_pproc_macro_table_get(&pp->macro_table, &tok.lexeme) != null);
|
||||
cbool condition = (type == SCC_PP_TOK_IFDEF) ? defined : !defined;
|
||||
scc_lexer_tok_drop(&tok);
|
||||
|
||||
scc_pproc_if_t new_if;
|
||||
new_if.found_true = condition;
|
||||
new_if.seen_else = 0;
|
||||
new_if.active = pp->enable ? condition : 0;
|
||||
scc_vec_push(pp->if_stack, new_if);
|
||||
|
||||
pp->enable = new_if.active;
|
||||
scc_lexer_skip_until_newline(pp->cur_ring);
|
||||
return;
|
||||
}
|
||||
case SCC_PP_TOK_ELIFDEF:
|
||||
case SCC_PP_TOK_ELIFNDEF:
|
||||
case SCC_PP_TOK_ENDIF:
|
||||
goto ERROR;
|
||||
case SCC_PP_TOK_ELIFNDEF: {
|
||||
if (scc_vec_size(pp->if_stack) == 0) {
|
||||
LOG_ERROR("#elif without #if");
|
||||
goto ERROR;
|
||||
}
|
||||
scc_pproc_if_t *top =
|
||||
&scc_vec_at(pp->if_stack, scc_vec_size(pp->if_stack) - 1);
|
||||
if (top->seen_else) {
|
||||
LOG_ERROR("#elif after #else");
|
||||
goto ERROR;
|
||||
}
|
||||
// 解析标识符
|
||||
if (!scc_lexer_next_non_blank(pp->cur_ring, &tok) ||
|
||||
tok.type != SCC_TOK_IDENT) {
|
||||
scc_lexer_tok_drop(&tok);
|
||||
LOG_ERROR("expected identifier");
|
||||
goto ERROR;
|
||||
}
|
||||
int defined =
|
||||
(scc_pproc_macro_table_get(&pp->macro_table, &tok.lexeme) != NULL);
|
||||
int condition = (type == SCC_PP_TOK_ELIFDEF) ? defined : !defined;
|
||||
scc_lexer_tok_drop(&tok);
|
||||
|
||||
if (top->found_true) {
|
||||
// 前面已有真分支,本 elif 不激活
|
||||
top->active = 0;
|
||||
} else {
|
||||
if (condition) {
|
||||
top->active = 1;
|
||||
top->found_true = 1;
|
||||
} else {
|
||||
top->active = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// seen_else 仍为 0
|
||||
pp->enable = top->active;
|
||||
scc_lexer_skip_until_newline(pp->cur_ring);
|
||||
return;
|
||||
}
|
||||
case SCC_PP_TOK_ELSE: {
|
||||
if (scc_vec_size(pp->if_stack) == 0) {
|
||||
LOG_ERROR("#else without #if");
|
||||
goto ERROR;
|
||||
}
|
||||
scc_pproc_if_t *top =
|
||||
&scc_vec_at(pp->if_stack, scc_vec_size(pp->if_stack) - 1);
|
||||
if (top->seen_else) {
|
||||
LOG_ERROR("multiple #else");
|
||||
goto ERROR;
|
||||
}
|
||||
|
||||
if (top->found_true) {
|
||||
top->active = 0;
|
||||
} else {
|
||||
top->active = 1;
|
||||
top->found_true = 1;
|
||||
}
|
||||
|
||||
top->seen_else = 1;
|
||||
|
||||
pp->enable = top->active;
|
||||
scc_lexer_skip_until_newline(pp->cur_ring);
|
||||
return;
|
||||
}
|
||||
case SCC_PP_TOK_ENDIF: {
|
||||
if (scc_vec_size(pp->if_stack) == 0) {
|
||||
LOG_ERROR("#endif without #if");
|
||||
} else {
|
||||
scc_vec_pop(pp->if_stack);
|
||||
}
|
||||
if (scc_vec_size(pp->if_stack) == 0) {
|
||||
pp->enable = 1;
|
||||
} else {
|
||||
pp->enable =
|
||||
scc_vec_at(pp->if_stack, scc_vec_size(pp->if_stack) - 1).active;
|
||||
}
|
||||
scc_lexer_skip_until_newline(pp->cur_ring);
|
||||
return;
|
||||
}
|
||||
case SCC_PP_TOK_IF:
|
||||
case SCC_PP_TOK_ELIF:
|
||||
// parse constant expression
|
||||
// 暂不实现表达式求值
|
||||
LOG_ERROR("Expression in #if/#elif not implemented");
|
||||
scc_lexer_skip_until_newline(pp->cur_ring);
|
||||
return;
|
||||
case SCC_PP_TOK_LINE:
|
||||
case SCC_PP_TOK_EMBED:
|
||||
goto ERROR;
|
||||
@@ -297,6 +427,7 @@ void scc_pproc_handle_directive(scc_pproc_t *pp) {
|
||||
}
|
||||
scc_lexer_tok_drop(&tok);
|
||||
}
|
||||
return;
|
||||
case SCC_PP_TOK_WARNING:
|
||||
scc_lexer_tok_drop(&tok);
|
||||
while (1) {
|
||||
@@ -309,6 +440,7 @@ void scc_pproc_handle_directive(scc_pproc_t *pp) {
|
||||
}
|
||||
scc_lexer_tok_drop(&tok);
|
||||
}
|
||||
return;
|
||||
case SCC_PP_TOK_PRAGMA:
|
||||
LOG_WARN("Pragma ignored");
|
||||
break;
|
||||
|
||||
@@ -25,6 +25,7 @@ static int switch_file_stack(scc_pproc_t *pp, scc_cstring_t *fname,
|
||||
scc_cstring_free(&fpath);
|
||||
scc_cstring_t *syspath = &scc_vec_at(pp->include_paths, i);
|
||||
scc_cstring_append(&fpath, syspath);
|
||||
scc_cstring_append_ch(&fpath, '/');
|
||||
scc_cstring_append(&fpath, fname);
|
||||
ret = scc_fexists(scc_cstring_as_cstr(&fpath));
|
||||
if (ret == true) {
|
||||
@@ -36,7 +37,13 @@ static int switch_file_stack(scc_pproc_t *pp, scc_cstring_t *fname,
|
||||
scc_cstring_as_cstr(fname), is_system ? '>' : '\"');
|
||||
return -1;
|
||||
FOPEN:
|
||||
scc_pproc_file_state_t *file = scc_malloc(sizeof(scc_pproc_file_state_t));
|
||||
if (scc_vec_size(pp->file_stack) >= pp->config.max_include_depth) {
|
||||
LOG_FATAL("Include depth is too deep, the include depth is %d, set "
|
||||
"MAX_INCLUDE_DEPTH is %d",
|
||||
scc_vec_size(pp->file_stack), pp->config.max_include_depth);
|
||||
}
|
||||
|
||||
scc_pproc_file_t *file = scc_malloc(sizeof(scc_pproc_file_t));
|
||||
Assert(file != null);
|
||||
if (scc_sstream_init(&(file->sstream), scc_cstring_as_cstr(&fpath), 1024)) {
|
||||
return -1;
|
||||
@@ -53,7 +60,7 @@ void scc_pproc_parse_include(scc_pproc_t *pp, scc_lexer_tok_t *include_tok) {
|
||||
int ok;
|
||||
scc_lexer_tok_t tok;
|
||||
scc_pos_t pos = include_tok->loc;
|
||||
scc_lexer_tok_drop(&tok);
|
||||
scc_lexer_tok_drop(include_tok);
|
||||
|
||||
scc_lexer_tok_ring_t *stream = pp->cur_ring;
|
||||
scc_lexer_tok_vec_t org_toks;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <pproc_expand.h>
|
||||
#include <scc_lexer_utils.h>
|
||||
#include <scc_pproc.h>
|
||||
|
||||
static int pproc_next_one_file(scc_pproc_t *pp, scc_lexer_tok_t *out) {
|
||||
@@ -25,13 +26,31 @@ CONTINUE:
|
||||
return true;
|
||||
}
|
||||
|
||||
if (pp->at_line_start && tok.type == SCC_TOK_SHARP) {
|
||||
// parse to #
|
||||
scc_pproc_handle_directive(pp);
|
||||
if (pp->at_line_start) {
|
||||
if (tok.type == SCC_TOK_SHARP) {
|
||||
// parse to #
|
||||
scc_pproc_handle_directive(pp);
|
||||
pp->at_line_start = true;
|
||||
goto CONTINUE;
|
||||
} else if (tok.type == SCC_TOK_BLANK) {
|
||||
scc_ring_next(*stream, *out, ok);
|
||||
scc_ring_peek(*stream, tok, ok);
|
||||
if (ok && tok.type == SCC_TOK_SHARP) {
|
||||
scc_pproc_handle_directive(pp);
|
||||
pp->at_line_start = true;
|
||||
goto CONTINUE;
|
||||
}
|
||||
scc_ring_back(*stream, ok);
|
||||
Assert(ok == true);
|
||||
scc_ring_peek(*stream, tok, ok);
|
||||
}
|
||||
}
|
||||
if (pp->enable == false) {
|
||||
scc_lexer_skip_until_newline(stream);
|
||||
pp->at_line_start = true;
|
||||
goto CONTINUE;
|
||||
}
|
||||
|
||||
pp->at_line_start = false;
|
||||
if (tok.type == SCC_TOK_IDENT) {
|
||||
// maybe expanded
|
||||
scc_pproc_macro_t *macro =
|
||||
@@ -62,7 +81,7 @@ CONTINUE:
|
||||
return false;
|
||||
}
|
||||
|
||||
scc_pproc_file_state_t *file = scc_vec_pop(pp->file_stack);
|
||||
scc_pproc_file_t *file = scc_vec_pop(pp->file_stack);
|
||||
Assert(file->ring == pp->cur_ring);
|
||||
scc_lexer_drop_ring(file->ring);
|
||||
scc_lexer_drop(&(file->lexer));
|
||||
@@ -88,6 +107,9 @@ void scc_pproc_init(scc_pproc_t *pp, scc_lexer_tok_ring_t *input) {
|
||||
scc_vec_init(pp->if_stack);
|
||||
scc_vec_init(pp->file_stack);
|
||||
pp->at_line_start = true;
|
||||
pp->enable = true;
|
||||
|
||||
pp->config.max_include_depth = 32;
|
||||
}
|
||||
|
||||
void scc_pproc_add_builtin_macros() {
|
||||
|
||||
@@ -17,7 +17,7 @@ static cbool process_input(const char *input, scc_cstring_t *output) {
|
||||
scc_pproc_init(&pp, scc_lexer_to_ring(&lexer, 8, true));
|
||||
|
||||
scc_lexer_tok_ring_t *tok_ring = scc_pproc_to_ring(&pp, 8);
|
||||
*output = scc_cstring_create();
|
||||
*output = scc_cstring_from_cstr("");
|
||||
scc_lexer_tok_t tok;
|
||||
while (1) {
|
||||
scc_ring_next_consume(*tok_ring, tok, ret);
|
||||
@@ -31,7 +31,6 @@ static cbool process_input(const char *input, scc_cstring_t *output) {
|
||||
scc_pproc_drop(&pp);
|
||||
scc_lexer_drop(&lexer);
|
||||
scc_sstream_drop(&mem_stream);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -127,6 +126,12 @@ static void test_define_nested_macros(void) {
|
||||
CHECK_PP_OUTPUT_EXACT(
|
||||
"#define A 1\n#define B (A + 1)\n#define C (B + 1)\nC\n",
|
||||
"((1 + 1) + 1)\n");
|
||||
|
||||
CHECK_PP_OUTPUT_EXACT("#define A\n", "");
|
||||
CHECK_PP_OUTPUT_EXACT("#undef A\n", "");
|
||||
|
||||
CHECK_PP_OUTPUT_EXACT(" # define A 1\nA", "1");
|
||||
// CHECK_PP_OUTPUT_EXACT(" # define A 1 \nA", "1"); // TODO
|
||||
}
|
||||
|
||||
static void test_undef_macros(void) {
|
||||
@@ -225,6 +230,126 @@ static void test_edge_cases(void) {
|
||||
CHECK_PP_OUTPUT_EXACT("#define A B\n#define B C\n#define C 1\nA\n", "1\n");
|
||||
}
|
||||
|
||||
static void test_conditional_ifdef(void) {
|
||||
TEST_CASE("ifdef and ifndef");
|
||||
|
||||
// 基本 ifdef / ifndef
|
||||
CHECK_PP_OUTPUT_EXACT("#define FOO\n"
|
||||
"#ifdef FOO\n"
|
||||
"foo\n"
|
||||
"#endif\n",
|
||||
"foo\n");
|
||||
|
||||
CHECK_PP_OUTPUT_EXACT("#define FOO\n"
|
||||
"#ifndef FOO\n"
|
||||
"foo\n"
|
||||
"#endif\n",
|
||||
"");
|
||||
|
||||
CHECK_PP_OUTPUT_EXACT("#undef FOO\n"
|
||||
"#ifdef FOO\n"
|
||||
"foo\n"
|
||||
"#endif\n",
|
||||
"");
|
||||
|
||||
CHECK_PP_OUTPUT_EXACT("#undef FOO\n"
|
||||
"#ifndef FOO\n"
|
||||
"foo\n"
|
||||
"#endif\n",
|
||||
"foo\n");
|
||||
|
||||
// ifdef + else
|
||||
CHECK_PP_OUTPUT_EXACT("#define FOO\n"
|
||||
"#ifdef FOO\n"
|
||||
"foo\n"
|
||||
"#else\n"
|
||||
"bar\n"
|
||||
"#endif\n",
|
||||
"foo\n");
|
||||
|
||||
CHECK_PP_OUTPUT_EXACT("#undef FOO\n"
|
||||
"#ifdef FOO\n"
|
||||
"foo\n"
|
||||
"#else\n"
|
||||
"bar\n"
|
||||
"#endif\n",
|
||||
"bar\n");
|
||||
|
||||
// ifdef + elifdef (C23)
|
||||
CHECK_PP_OUTPUT_EXACT("#define FOO\n"
|
||||
"#ifdef FOO\n"
|
||||
"foo\n"
|
||||
"#elifdef FOO\n"
|
||||
"foo2\n"
|
||||
"#endif\n",
|
||||
"foo\n");
|
||||
|
||||
CHECK_PP_OUTPUT_EXACT("#undef FOO\n"
|
||||
"#define BAR\n"
|
||||
"#ifdef FOO\n"
|
||||
"foo\n"
|
||||
"#elifdef BAR\n"
|
||||
"bar\n"
|
||||
"#else\n"
|
||||
"none\n"
|
||||
"#endif\n",
|
||||
"bar\n");
|
||||
|
||||
CHECK_PP_OUTPUT_EXACT("#undef FOO\n"
|
||||
"#undef BAR\n"
|
||||
"#ifdef FOO\n"
|
||||
"foo\n"
|
||||
"#elifdef BAR\n"
|
||||
"bar\n"
|
||||
"#else\n"
|
||||
"none\n"
|
||||
"#endif\n",
|
||||
"none\n");
|
||||
|
||||
// 嵌套
|
||||
CHECK_PP_OUTPUT_EXACT("#define A\n"
|
||||
"#ifdef A\n"
|
||||
" #ifdef B\n"
|
||||
" inner\n"
|
||||
" #endif\n"
|
||||
" outer\n"
|
||||
"#endif\n",
|
||||
" outer\n");
|
||||
|
||||
CHECK_PP_OUTPUT_EXACT("#define B\n"
|
||||
"#ifndef A\n"
|
||||
" #ifdef B\n"
|
||||
" inner\n"
|
||||
" #endif\n"
|
||||
" outer\n"
|
||||
"#endif\n",
|
||||
" inner\n outer\n");
|
||||
|
||||
// 外层假,内层真
|
||||
CHECK_PP_OUTPUT_EXACT("#ifdef __NONE\n"
|
||||
"#define OUTER\n"
|
||||
"#endif\n"
|
||||
"#ifdef OUTER\n"
|
||||
"should not appear\n"
|
||||
"#endif\n",
|
||||
""); // 期望为空
|
||||
|
||||
// 更复杂的嵌套条件
|
||||
CHECK_PP_OUTPUT_EXACT("#define X\n"
|
||||
"#ifdef X\n"
|
||||
"x defined\n"
|
||||
"#ifdef Y\n"
|
||||
"Y defined\n"
|
||||
"#else\n"
|
||||
"Y not defined\n"
|
||||
"#endif\n"
|
||||
"after inner\n"
|
||||
"#else\n"
|
||||
"X not defined\n"
|
||||
"#endif\n",
|
||||
"x defined\nY not defined\nafter inner\n");
|
||||
}
|
||||
|
||||
#define TEST_LIST_CASE(func_name) {#func_name, func_name}
|
||||
TEST_LIST = {
|
||||
TEST_LIST_CASE(test_define_simple_no_macro),
|
||||
@@ -237,5 +362,6 @@ TEST_LIST = {
|
||||
TEST_LIST_CASE(test_define_nested_macros),
|
||||
TEST_LIST_CASE(test_undef_macros),
|
||||
TEST_LIST_CASE(hard_test_define_func_macros),
|
||||
TEST_LIST_CASE(test_conditional_ifdef),
|
||||
{NULL, NULL},
|
||||
};
|
||||
Reference in New Issue
Block a user