首页 > 求一款C语言的预处理工具

求一款C语言的预处理工具

求一款C语言预处理的工具,它仅仅对#if和#ifdef进行处理而不对#include进行处理,使用它可以简化源代码,提高可读性。我记得以前看到过具备如上功能的工具,但忘记它的名字了,有谁知道这款工具的名字吗?谢谢回答了!

这款工具的功能如下:
(1) 输入文件input.c:

#include <stdio.h>
#define CONFIG 1
int main()
{
#if CONFIG 
    return 1;
#else
    return 0;
#endif
}

(2) 经过工具对input.c处理后,输出output.c如下:

#include <stdio.h>  // 保留该行,不要对include语句进行展开处理
#define OPTION 1
int main()
{
    return 1;
}

我找到答案了,在google上搜索"c preprocessor eliminate",第一条结果就是我想要的答案。

Is there a C pre-processor which eliminates #ifdef blocks based on values defined/undefined?

【热门文章】
【热门文章】