Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这可能吗?
基本上,我想做的是这样的:
#includeIfItExists "header.h"
如果 header.h 不存在,编译器将继续其愉快的方式。
我绝不是 C 专家,但我不相信这在本地是可能的。我认为推荐的路线是在编译器级别使用命名宏传递,-D如果它已定义(或可能未定义),则执行您的包含。这样,编译程序的人必须有意识地决定跳过包含(或包含它)。
-D