Can I write or in #ifdef?

Asked 2 years ago, Updated 2 years ago, 98 views

It's a very basic question, so I'm a little shy

I'm going to do the same thing on Linux and Android, so I'm going to tie them up. I thought I could do | of course, but I couldn't...

How should I write "or" in ifdef?

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

c c++ macro

2022-09-22 22:10

1 Answers

Of course you can do or.

I have to use two | but it was a problem because I used only one

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


2022-09-22 22:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.