Reputation: 455
To handle platform specific code between Mac and Windows, WIN32 and APPLE are the terms to use, right?
So, thw code would look like this:
#ifdef _WIN32
// Windows code
#endif
#ifdef __APPLE__
// Mac code
#endif
What about Linux ?
How can i do that for all three? right
Upvotes: 4
Views: 207
Reputation: 121407
It's similar:
#ifdef __linux__
// Linux code
#endif
Since you are going to have either one of these three defined at a time, this should be ok for all three.
Upvotes: 6