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.
我希望能够通过宏阻止存档构建(用于分发),这样我就不会忘记添加或更改关键功能。
理想情况下,我想做:
#define REQUIRE_FIX(ERROR_MSG) (\ #if __ \ #error ERROR_MSG \ #endif)
我需要做什么__来检查当前的构建类型/方案?
__
您可以在目标的构建选项中为每个构建方案设置预处理器定义。
通常要阻止存档构建,我只会使用
#ifndef DEBUG #error "Fix this first!" #endif