#ifdef inside #define

前端 未结 6 1879
情书的邮戳
情书的邮戳 2020-11-29 02:31

I am trying to write something like this:

#define COV_ON(x) \\
                #ifdef COVERAGE_TOOL \\
                    _Pragma (COVERAGE #x)
                     


        
6条回答
  •  清歌不尽
    2020-11-29 03:13

    Not possible. Do it the other way around:

    #ifdef COVERAGE_TOOL
    #define COV_ON(x) _Pragma (COVERAGE #x)
    #else
    #define COV_ON(x)
    #endif
    

提交回复
热议问题