User forums > General (but related to Code::Blocks)
Cross Platform with Code::Blocks
(1/1)
shadowayex:
I want to use Code::Blocks to compile cross-platform code, but I need to use the C++ preprocessor at times to swap between platform specific code.
One case is I need to detect when I'm in Windows and when I'm in *nix based systems. I always install Code::Blocks with the compiler that comes with it, so I need to know what macros are defined to detect when I'm in the Windows version or in the *nix version. I can't find the macros by Googling, so I thought I'd ask here.
kencamargo:
--- Quote from: shadowayex on August 28, 2010, 02:21:05 am ---I can't find the macros by Googling, so I thought I'd ask here.
--- End quote ---
I guess you are not up to date with your google fares. :) Have you tried, for instance, http://predef.sourceforge.net/preos.html?
This is not a codeblocks issue, though, and this topic stands a great chance of being locked. Please check forum guidelines.
Ken
shadowayex:
I thought they were different going from one place to another, I figured I'd see what Code::Blocks were.
Thanks for the list though, That should cover everything, I hope.
kencamargo:
--- Quote from: shadowayex on August 28, 2010, 06:30:56 pm ---I thought they were different going from one place to another, I figured I'd see what Code::Blocks were.
--- End quote ---
As you'll see it often repeated if you just hang around enough, codeblocks is "just" an IDE. It works with dozens of compilers on almost as many OSs. Predefined macros are compiler-specific, and the IDE does not, and does not have to, know anything about them.
--- Quote ---Thanks for the list though, That should cover everything, I hope.
--- End quote ---
You're welcome, but better abide by forum rules...
Ken
Navigation
[0] Message Index
Go to full version