📅 2015-Oct-26 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ cpp, macro, operating system, preprocessor ⬩ 📚 Archive
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 Windows: _WIN32
For Linux: __linux__
For UNIX: __unix__