I just saw this thread, describing how to add conditional macros: Conditional value for a #define
但就我的情况而言,我正在确定一项职能。
#if TARGET_IPHONE_SIMULATOR
#define doSomething(){
\ does something
}
#else
#define doSomething(){
\ does something else
}
#endif
这样做确实可行,但我却使编审员屈服于这一警告:
"doSomething" redefined
This is the location of the previous arguments
是否有任何工作帮助消除警告?
<><>UPDATE:
因此,我试图在我的定义中列入条件:
#define doSomething(){
#if TARGET_IPHONE_SIMULATOR
\ do something
#else
\ do something else
#endif
}
但是,这犯了一个错误:
error: # is not followed by a macro parameter.