Use _WIN32 define instead of WIN32 to detect Windows build (see http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.80).aspx)