|| in ifdef

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 1:48pm
because its giving me error while compiling...
"source/lib/taap/src/messageMMap.cpp", line 419: Error: There is extra text on this line.
..
So i am not sure..
Nov 18, 2010 at 2:13pm
You cannot use it with #ifdef ...
You must use it with #if
Nov 18, 2010 at 2:23pm
Duos and moorecm thanks for your reply.
Do u wanted to do like
#if _WIN32 //|| #if GNU
this??
Nov 18, 2010 at 7:27pm
#if defined(_WIN32) || defined(GNU)
just like the example moorecm has already given you.

Good luck!
Topic archived. No new replies allowed.