#if preprocessor directive for directives other than DEBUG

前端 未结 4 2077
暖寄归人
暖寄归人 2020-12-30 19:13

I know that I can use preprocessor directives to check for Debug/Release by doing this:

#if DEBUG
    //debug mode
#elif
    //release mode
#endif

4条回答
  •  旧时难觅i
    2020-12-30 19:59

    Simple answer is

    • Go to Project->[Project name] Properties->Build
    • Set checked [] Define DEBUG

    Now you can play with DEBUG predecessor directive like

    #if DEBUG
    ...
    #else
    ...
    #endif
    

提交回复
热议问题