how to use #ifdef with an OR condition?

2019-01-29 22:52发布

问题:

Sorry for asking very basic question. I would like to set OR condition in #ifdef directive.? How to do that ? I tried

#ifdef LINUX | ANDROID
...
..
#endif 

It did not work? What is the proper way?

回答1:

Like this

#if defined(LINUX) || defined(ANDROID)


标签: c macros