C++ compiling on Windows and Linux: ifdef switch [duplicate]

use:

#ifdef __linux__ 
    //linux code goes here
#elif _WIN32
    // windows code goes here
#else

#endif

Leave a Comment