use:
#ifdef __linux__
//linux code goes here
#elif _WIN32
// windows code goes here
#else
#endif
More Related Contents:
- C++ cross-compiler from Windows to Linux [closed]
- Sharing a global/static variable between a process and DLL
- When including header files, is the path case sensitive?
- Detect Windows or Linux in C, C++ [duplicate]
- How do I clear the console in BOTH Windows and Linux using C++
- generates same number in Linux, but not in Windows
- strptime() equivalent on Windows?
- How can I clear console
- Export all symbols when creating a DLL
- How do I calculate the week number given a date?
- boost_1_60_0 .zip installation in windows
- c++, usleep() is obsolete, workarounds for Windows/MingW?
- Linking libstdc++ statically: any gotchas?
- How can I redirect stdout to some visible display in a Windows Application?
- C++ new operator thread safety in linux and gcc 4
- How to pretty-print STL containers in GDB?
- Windows/C++: Is it possible to find the line of code where exception was thrown having “Exception Offset”
- How do I implement dragging a window using its client area?
- “relocation R_X86_64_32S against ” linking Error
- What is the purpose of the _chkstk() function?
- How do I add the MinGW bin directory to my system path?
- Programmatically access CPU fan on a laptop? (Windows)
- VC++ fatal error LNK1168: cannot open filename.exe for writing
- version `CXXABI_1.3.8′ not found (required by …) [duplicate]
- Sorry, unimplemented: 64 bit mode not compiled in
- Differences between running an executable with Visual Studio debugger vs without debugger
- What is the maximum memory available to a C++ application on 32-bit Windows?
- Find available network interfaces in C/C++? [closed]
- How to get the starting/base address of a process in C++?
- How can I find the size of all files located inside a folder?