我曾在项目偏好中设想过其中之一
TESTING=HOSTTESTING=TARGETTESTING完全没有定义
我的问题是后者。
似乎不是
#if TESTING==HOST
#error "HOST defined" // add temporarilly for testing porpoises
#endif
我需要编码
#ifdef TESTING
#if TESTING==HOST
#error "HOST defined" // add temporarilly for testing porpoises
#endif
#endif
我确信这不是标准行为,因为 ifTESTING没有定义那么它肯定不等于HOST,而且我不需要#ifdef TESTINGGCC 编译器的额外内容。
但是,当我使用 Atmel AVR Studio(我认为它基于 MS Visual Studio)时,有必要#ifdef TESTING在几十个地方添加该首字母 :-(
看起来我别无选择,但我只是想知道是否有任何 C 标准真的需要这个。