I need my code to do different things based on the operating system on which it gets compiled. I\'m looking for something like this:
#ifdef OSisWindows
// do
Use #define OSsymbol
and #ifdef OSsymbol
where OSsymbol is a #define
'able symbol identifying your target OS.
Typically you would include a central header file defining the selected OS symbol and use OS-specific include and library directories to compile and build.
You did not specify your development environment, but I'm pretty sure your compiler provides global defines for common platforms and OSes.
See also http://en.wikibooks.org/wiki/C_Programming/Preprocessor