Nov 18, 2010 at 12:46pm
Can we use || operator in ifdef??
e.g. #ifdef _WIN32 || GNU
Nov 18, 2010 at 1:28pm
I haven't taken notice of that specifically using an #ifdef, but I have seen things like this in the Boost source:
1 2 3
|
# if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE)
//...
# endif
|
Last edited on Nov 18, 2010 at 1:30pm
Nov 18, 2010 at 2:13pm
You cannot use it with #ifdef
...
You must use it with #if
Nov 18, 2010 at 7:27pm
#if defined(_WIN32) || defined(GNU)
just like the example moorecm has already given you.
Good luck!