C or C++ code that needs to be ported across multiple operating systems will inevitably end up using pre-processor directives. These directives will look for the pre-defined macros defined by the compilers or OSes on which the code needs to be compiled or run.
A comprehensive and updated list of the compiler macros for operating systems is here.
- For Linux:
- For UNIX: