I would like to set OR condition in #ifdef directive.?
I tried:
#ifdef LINUX | ANDROID
...
..
#endif
It did not work? What is the proper way?
#if defined LINUX || defined ANDROID
// your code here
#endif /* LINUX || ANDROID */
or-
#if defined(LINUX) || defined(ANDROID)
// your code here
#endif /* LINUX || ANDROID */
Both above are the same, which one you use simply depends on your taste.
P.S.: #ifdef is simply the short form of #if defined, however, does not support complex condition.
Further-
#if defined LINUX && defined ANDROID#if defined LINUX ^ defined ANDROID
|for "or" in your C conditionals too, you're doing it wrong.