How to add a 'or' condition in #ifdef

前端 未结 3 1277
情话喂你
情话喂你 2020-12-22 21:15

How can I add a \'or\' condition in #ifdef ?

I have tried:

#ifdef CONDITION1 || CONDITION2

#endif
3条回答
  •  余生分开走
    2020-12-22 21:54

    #if defined(CONDITION1) || defined(CONDITION2)
    

    should work. :)

    #ifdef is a bit less typing, but doesn't work well with more complex conditions

提交回复
热议问题