Archived

This topic is now archived and is closed to further replies.

shaobohou

how to detect when compiling on win32

Recommended Posts

This is something I thought I did correctly I have a function that requires different to be compile depends on whether you are in windows or in linux, so: #ifdef WIN32 #include <windows.h> windows code #else linux code #endif this is used to work, I took the code into a different program and try to compile it with dev-cpp, it seems not longer able to differentiate when it is in windows thus causing compiler error. What is the standard way for detecting if you compiling on windows ?

Share this post


Link to post
Share on other sites