<分区>
是否有独立的 C++ 预处理器?我不需要编译器/链接器,而且我无法安装完整的工具包。
我希望能够使用我提供的一些定义和包含路径获得一些 header 的预处理版本。
编辑:我不能依赖任何可用的东西。没有 cl,没有 gcc,什么都没有。我至少需要做的是处理宏(特别是 #ifdef 和 #if )。
编辑:我在 Windows XP 计算机上使用它。
<分区>
是否有独立的 C++ 预处理器?我不需要编译器/链接器,而且我无法安装完整的工具包。
我希望能够使用我提供的一些定义和包含路径获得一些 header 的预处理版本。
编辑:我不能依赖任何可用的东西。没有 cl,没有 gcc,什么都没有。我至少需要做的是处理宏(特别是 #ifdef 和 #if )。
编辑:我在 Windows XP 计算机上使用它。
最佳答案
cpp 就是您要找的。不过,我不确定它是否可以在 gcc 发行版之外获得
CPP(1) GNU CPP(1)
NAME
cpp - The C Preprocessor
SYNOPSIS
cpp [-Dmacro[=defn]...] [-Umacro]
[-Idir...] [-Wwarn...]
[-M|-MM] [-MG] [-MF filename]
[-MP] [-MQ target...]
[-MT target...]
[-P] [-fno-working-directory]
[-x language] [-std=standard]
infile outfile
Only the most useful options are listed here; see below for the remainder.
DESCRIPTION
The C preprocessor, often known as cpp, is a macro processor that is used automatically by the C compiler to transform your program before
compilation. It is called a macro processor because it allows you to define macros, which are brief abbreviations for longer constructs.
关于c++ - 是否有独立的 C++ 源代码预处理器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1645538/