diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in index dd6826135..c9d5008f9 100644 --- a/Modules/CMakeCCompiler.cmake.in +++ b/Modules/CMakeCCompiler.cmake.in @@ -3,4 +3,14 @@ SET(CMAKE_AR "@CMAKE_AR@") SET(CMAKE_RANLIB "@CMAKE_RANLIB@") SET(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@) SET(CMAKE_C_COMPILER_LOADED 1) +SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@) +SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@) +IF(CMAKE_COMPILER_IS_CYGWIN) + SET(CYGWIN 1) + SET(UNIX 1) +ENDIF(CMAKE_COMPILER_IS_CYGWIN) + +IF(CMAKE_COMPILER_IS_MINGW) + SET(MINGW 1) +ENDIF(CMAKE_COMPILER_IS_MINGW) diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index e85b2f02c..230c13213 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -59,6 +59,13 @@ IF(NOT CMAKE_COMPILER_RETURN) "Determining if the C compiler is GNU failed with " "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n") ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" ) + IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" ) + SET(CMAKE_COMPILER_IS_MINGW 1) + ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" ) + IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" ) + SET(CMAKE_COMPILER_IS_CYGWIN 1) + ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" ) + ENDIF(NOT CMAKE_COMPILER_RETURN) diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake index 8dc48160e..cd2249962 100644 --- a/Modules/CMakeSystemSpecificInformation.cmake +++ b/Modules/CMakeSystemSpecificInformation.cmake @@ -57,9 +57,9 @@ ENDIF(EXISTS ${CMAKE_SYSTEM_INFO_FILE}) IF(CMAKE_C_COMPILER) GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE) # since the gnu compiler has several names force gcc - IF(CMAKE_COMPILER_IS_GNUGCC) + IF(CMAKE_COMPILER_IS_GNUCC) SET(CMAKE_BASE_NAME gcc) - ENDIF(CMAKE_COMPILER_IS_GNUGCC) + ENDIF(CMAKE_COMPILER_IS_GNUCC) SET(CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) INCLUDE(${CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE} OPTIONAL) diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake index d3fa13c41..a61910842 100644 --- a/Modules/CMakeTestCCompiler.cmake +++ b/Modules/CMakeTestCCompiler.cmake @@ -1,6 +1,6 @@ # This file is used by EnableLanguage in cmGlobalGenerator to # determine that that selected C compiler can actually compile -# and like the most basic of programs. If not, a fatel error +# and link the most basic of programs. If not, a fatel error # is set and cmake stops processing commands and will not generate # any makefiles or projects. IF(NOT CMAKE_C_COMPILER_WORKS) diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake index dd875da75..9f2844652 100644 --- a/Modules/CMakeTestCXXCompiler.cmake +++ b/Modules/CMakeTestCXXCompiler.cmake @@ -1,6 +1,6 @@ # This file is used by EnableLanguage in cmGlobalGenerator to # determine that that selected C++ compiler can actually compile -# and like the most basic of programs. If not, a fatel error +# and link the most basic of programs. If not, a fatel error # is set and cmake stops processing commands and will not generate # any makefiles or projects. IF(NOT CMAKE_CXX_COMPILER_WORKS) diff --git a/Modules/CMakeTestGNU.c b/Modules/CMakeTestGNU.c index 63fd2b240..386614a1b 100644 --- a/Modules/CMakeTestGNU.c +++ b/Modules/CMakeTestGNU.c @@ -1,3 +1,9 @@ #ifdef __GNUC__ void THIS_IS_GNU(); #endif +#ifdef __MINGW32__ +void THIS_IS_MINGW(); +#endif +#ifdef __CYGWIN__ +void THIS_IS_CYGWIN(); +#endif diff --git a/Modules/Platform/Windows-bcc32.cmake b/Modules/Platform/Windows-bcc32.cmake index db08463b5..e7f5be9d1 100644 --- a/Modules/Platform/Windows-bcc32.cmake +++ b/Modules/Platform/Windows-bcc32.cmake @@ -14,9 +14,8 @@ SET(CMAKE_LIBRARY_PATH_FLAG "-L") SET(CMAKE_LINK_LIBRARY_FLAG "") SET(CMAKE_SHARED_BUILD_CXX_FLAGS "-tWR") SET(CMAKE_SHARED_BUILD_C_FLAGS "-tWR") +SET(BORLAND 1) -SET(CMAKE_START_TEMP_FILE "@&&|\n") -SET(CMAKE_END_TEMP_FILE "\n|") # uncomment these out to debug makefiles #SET(CMAKE_START_TEMP_FILE "") #SET(CMAKE_END_TEMP_FILE "") diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index e1e661eaf..9e31f595e 100644 --- a/Modules/Platform/Windows-cl.cmake +++ b/Modules/Platform/Windows-cl.cmake @@ -1,13 +1,6 @@ SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") SET(CMAKE_LINK_LIBRARY_FLAG "") - -SET(CMAKE_START_TEMP_FILE "@<<\n") -SET(CMAKE_END_TEMP_FILE "\n<<") -# uncomment these out to debug makefiles -#SET(CMAKE_START_TEMP_FILE "") -#SET(CMAKE_END_TEMP_FILE "") -#SET(CMAKE_VERBOSE_MAKEFILE 1) - +SET(WIN32 1) # create a shared C++ library SET(CMAKE_CXX_CREATE_SHARED_LIBRARY "link /nologo ${CMAKE_START_TEMP_FILE} /out: /dll ${CMAKE_END_TEMP_FILE}") diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake index cf465161c..29198b5b9 100644 --- a/Modules/Platform/Windows.cmake +++ b/Modules/Platform/Windows.cmake @@ -4,3 +4,25 @@ SET(CMAKE_SHARED_LIBRARY_PREFIX "") # lib SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") # .so SET(CMAKE_LINK_LIBRARY_SUFFIX ".lib") SET(CMAKE_DL_LIBS "") + +# for borland make long command lines are redirected to a file +# with the following syntax, see Windows-bcc32.cmake for use +IF(CMAKE_GENERATOR MATCHES "Borland") + SET(CMAKE_START_TEMP_FILE "@&&|\n") + SET(CMAKE_END_TEMP_FILE "\n|") +ENDIF(CMAKE_GENERATOR MATCHES "Borland") + +# for nmake make long command lines are redirected to a file +# with the following syntax, see Windows-bcc32.cmake for use +IF(CMAKE_GENERATOR MATCHES "NMake") + SET(CMAKE_START_TEMP_FILE "@<<\n") + SET(CMAKE_END_TEMP_FILE "\n<<") +ENDIF(CMAKE_GENERATOR MATCHES "NMake") + +# uncomment these out to debug nmake and borland makefiles +#SET(CMAKE_START_TEMP_FILE "") +#SET(CMAKE_END_TEMP_FILE "") +#SET(CMAKE_VERBOSE_MAKEFILE 1) + + + diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 35de8826c..b06883a03 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -65,22 +65,25 @@ ENDIF (APPLE) IF (WIN32) IF(NOT UNIX) SET(SRCS ${SRCS} - cmGlobalBorlandMakefileGenerator.cxx - cmGlobalNMakeMakefileGenerator.cxx - cmGlobalVisualStudio6Generator.cxx - cmLocalVisualStudio6Generator.cxx - cmGlobalVisualStudio71Generator.cxx - cmGlobalVisualStudio7Generator.cxx - cmLocalVisualStudio7Generator.cxx - cmGlobalBorlandMakefileGenerator.h - cmGlobalNMakeMakefileGenerator.h - cmGlobalVisualStudio6Generator.h - cmLocalVisualStudio6Generator.h - cmGlobalVisualStudio7Generator.h - cmLocalVisualStudio7Generator.h - cmWin32ProcessExecution.cxx - cmWin32ProcessExecution.h - ) + cmGlobalBorlandMakefileGenerator.cxx + cmGlobalNMakeMakefileGenerator.cxx + cmGlobalVisualStudio6Generator.cxx + cmLocalVisualStudio6Generator.cxx + cmGlobalBorlandMakefileGenerator.h + cmGlobalNMakeMakefileGenerator.h + cmGlobalVisualStudio6Generator.h + cmLocalVisualStudio6Generator.h + cmWin32ProcessExecution.cxx + cmWin32ProcessExecution.h + ) + IF(NOT MINGW) + SET(SRCS ${SRCS} + cmGlobalVisualStudio7Generator.h + cmLocalVisualStudio7Generator.h + cmGlobalVisualStudio71Generator.cxx + cmGlobalVisualStudio7Generator.cxx + cmLocalVisualStudio7Generator.cxx) + ENDIF(NOT MINGW) ENDIF(NOT UNIX) ENDIF (WIN32) @@ -95,10 +98,12 @@ LINK_DIRECTORIES(${CMake_BINARY_DIR}/Source) IF (WIN32) IF(NOT UNIX) IF( NOT BORLAND ) - LINK_LIBRARIES( rpcrt4.lib ) - ADD_EXECUTABLE(cmw9xcom cmw9xcom.cxx) - TARGET_LINK_LIBRARIES(cmw9xcom CMakeLib) - SUBDIRS(MFCDialog) + IF(NOT MINGW ) + LINK_LIBRARIES( rpcrt4.lib ) + ADD_EXECUTABLE(cmw9xcom cmw9xcom.cxx) + TARGET_LINK_LIBRARIES(cmw9xcom CMakeLib) + SUBDIRS(MFCDialog) + ENDIF(NOT MINGW ) ENDIF( NOT BORLAND ) ENDIF(NOT UNIX) ENDIF (WIN32) diff --git a/Source/CTest/Curl/telnet.c b/Source/CTest/Curl/telnet.c index c9db4cabc..ef1b82873 100644 --- a/Source/CTest/Curl/telnet.c +++ b/Source/CTest/Curl/telnet.c @@ -1105,7 +1105,7 @@ CURLcode Curl_telnet(struct connectdata *conn) ssize_t bytes_written; char *buffer = buf; - if(!ReadFile(stdin_handle, buf, 255, &(DWORD)nread, NULL)) { + if(!ReadFile(stdin_handle, buf, 255, ((DWORD*)&nread), NULL)) { keepon = FALSE; break; } diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx index d9cd11918..8a936103f 100644 --- a/Source/cmDynamicLoader.cxx +++ b/Source/cmDynamicLoader.cxx @@ -266,7 +266,7 @@ cmDynamicLoader::GetSymbolAddress(cmLibHandle lib, const char* sym) delete [] wsym; void* result = ret; #else - void* result = GetProcAddress(lib, sym); + void* result = (void*)GetProcAddress(lib, sym); #endif // Hack to cast pointer-to-data to pointer-to-function. return *reinterpret_cast(&result); diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index 5d9b6c350..cc384da8b 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx @@ -21,6 +21,7 @@ cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator() { m_FindMakeProgramFile = "CMakeBorlandFindMake.cmake"; + m_ForceUnixPaths = false; } void cmGlobalBorlandMakefileGenerator::EnableLanguage(const char* l, diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index e5b83e86b..85f197f54 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -28,7 +28,8 @@ int cmGlobalGenerator::s_TryCompileTimeout = 0; cmGlobalGenerator::cmGlobalGenerator() { -// do nothing duh + // by default use the native paths + m_ForceUnixPaths = false; } cmGlobalGenerator::~cmGlobalGenerator() diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 20dcc088e..3f4b1e3f2 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -104,7 +104,9 @@ public: void GetLocalGenerators(std::vector&g) { g = m_LocalGenerators;} static int s_TryCompileTimeout; + bool GetForceUnixPaths() {return m_ForceUnixPaths;} protected: + bool m_ForceUnixPaths; cmStdString m_FindMakeProgramFile; cmStdString m_ConfiguredFilesPath; cmake *m_CMakeInstance; diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index 08b48c88b..8615dd5a1 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/Source/cmGlobalNMakeMakefileGenerator.cxx @@ -22,6 +22,7 @@ cmGlobalNMakeMakefileGenerator::cmGlobalNMakeMakefileGenerator() { m_FindMakeProgramFile = "CMakeNMakeFindMake.cmake"; + m_ForceUnixPaths = false; } void cmGlobalNMakeMakefileGenerator::EnableLanguage(const char* l, diff --git a/Source/cmGlobalUnixMakefileGenerator.cxx b/Source/cmGlobalUnixMakefileGenerator.cxx index 79bbc38f6..8719fbd72 100644 --- a/Source/cmGlobalUnixMakefileGenerator.cxx +++ b/Source/cmGlobalUnixMakefileGenerator.cxx @@ -22,6 +22,8 @@ cmGlobalUnixMakefileGenerator::cmGlobalUnixMakefileGenerator() { + // This type of makefile always requires unix style paths + m_ForceUnixPaths = true; m_FindMakeProgramFile = "CMakeUnixFindMake.cmake"; } diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index f77e7e356..01a535e19 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -2117,7 +2117,7 @@ cmLocalUnixMakefileGenerator::ConvertToOutputForExisting(const char* p) { if(!cmSystemTools::GetShortPath(ret.c_str(), ret)) { - ret = p; + ret = cmSystemTools::ConvertToOutputPath(p); } } } diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 69ce0afcc..95746243a 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -48,6 +48,7 @@ bool cmSystemTools::s_DisableRunCommandOutput = false; bool cmSystemTools::s_ErrorOccured = false; bool cmSystemTools::s_FatalErrorOccured = false; bool cmSystemTools::s_DisableMessages = false; +bool cmSystemTools::s_ForceUnixPaths = false; std::string cmSystemTools::s_Windows9xComspecSubstitute = "command.com"; void cmSystemTools::SetWindows9xComspecSubstitute(const char* str) @@ -1032,3 +1033,17 @@ bool cmSystemTools::Split(const char* s, std::vector& l) } return true; } + +std::string cmSystemTools::ConvertToOutputPath(const char* path) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + if(s_ForceUnixPaths) + { + return cmSystemTools::ConvertToUnixOutputPath(path); + } + return cmSystemTools::ConvertToWindowsOutputPath(path); +#else + return cmSystemTools::ConvertToUnixOutputPath(path); +#endif +} + diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 2ecd504f9..724c5ec44 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -235,8 +235,14 @@ public: /** Split a string on its newlines into multiple lines. Returns false only if the last line stored had no newline. */ static bool Split(const char* s, std::vector& l); - + static void SetForceUnixPaths(bool v) + { + s_ForceUnixPaths = v; + } + static std::string ConvertToOutputPath(const char* path); + private: + static bool s_ForceUnixPaths; static bool s_RunCommandHideConsole; static bool s_ErrorOccured; static bool s_FatalErrorOccured; diff --git a/Source/cmWin32ProcessExecution.cxx b/Source/cmWin32ProcessExecution.cxx index f718e237b..b7eaea728 100644 --- a/Source/cmWin32ProcessExecution.cxx +++ b/Source/cmWin32ProcessExecution.cxx @@ -291,16 +291,17 @@ static BOOL RealPopenCreateProcess(const char *cmdstring, { PROCESS_INFORMATION piProcInfo; STARTUPINFO siStartInfo; - char *s1,*s2, *s3 = " /c "; + char *s1=0,*s2=0, *s3 = " /c "; int i; int x; if (i = GetEnvironmentVariable("COMSPEC",NULL,0)) { char *comshell; - s1 = (char *)_alloca(i); + s1 = (char *)malloc(i); if (!(x = GetEnvironmentVariable("COMSPEC", s1, i))) { + free(s1); return x; } @@ -317,7 +318,7 @@ static BOOL RealPopenCreateProcess(const char *cmdstring, { /* NT/2000 and not using command.com. */ x = i + (int)strlen(s3) + (int)strlen(cmdstring) + 1; - s2 = (char *)_alloca(x); + s2 = (char *)malloc(x); ZeroMemory(s2, x); //sprintf(s2, "%s%s%s", s1, s3, cmdstring); sprintf(s2, "%s", cmdstring); @@ -366,15 +367,20 @@ static BOOL RealPopenCreateProcess(const char *cmdstring, << "Can not locate '" << modulepath << "' which is needed " "for popen to work with your shell " - "or platform." << std::endl; + "or platform." << std::endl; + free(s1); + free(s2); return FALSE; } } x = i + (int)strlen(s3) + (int)strlen(cmdstring) + 1 + (int)strlen(modulepath) + (int)strlen(szConsoleSpawn) + 1; - - s2 = (char *)_alloca(x); + if(s2) + { + free(s2); + } + s2 = (char *)malloc(x); ZeroMemory(s2, x); sprintf( s2, @@ -396,7 +402,9 @@ static BOOL RealPopenCreateProcess(const char *cmdstring, else { std::cout << "Cannot locate a COMSPEC environment variable to " - << "use as the shell" << std::endl; + << "use as the shell" << std::endl; + free(s2); + free(s1); return FALSE; } @@ -429,11 +437,15 @@ static BOOL RealPopenCreateProcess(const char *cmdstring, /* Return process handle */ *hProcess = piProcInfo.hProcess; //std::cout << "Process created..." << std::endl; + free(s2); + free(s1); return TRUE; } output += "CreateProcessError "; output += s2; output += "\n"; + free(s2); + free(s1); return FALSE; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e2dee840e..c4c73dd19 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -26,10 +26,13 @@ // include the generator #if defined(_WIN32) && !defined(__CYGWIN__) #include "cmGlobalVisualStudio6Generator.h" +#if !defined(__MINGW32__) #include "cmGlobalVisualStudio7Generator.h" #include "cmGlobalVisualStudio71Generator.h" +#endif #include "cmGlobalBorlandMakefileGenerator.h" #include "cmGlobalNMakeMakefileGenerator.h" +#include "cmGlobalUnixMakefileGenerator.h" #include "cmWin32ProcessExecution.h" #else #include "cmGlobalUnixMakefileGenerator.h" @@ -795,6 +798,10 @@ void cmake::SetGlobalGenerator(cmGlobalGenerator *gg) // set the new m_GlobalGenerator = gg; + // set the global flag for unix style paths on cmSystemTools as + // soon as the generator is set. This allows gmake to be used + // on windows. + cmSystemTools::SetForceUnixPaths(m_GlobalGenerator->GetForceUnixPaths()); // Save the environment variables CXX and CC m_CXXEnvironment = getenv("CXX"); m_CCEnvironment = getenv("CC"); @@ -877,6 +884,10 @@ int cmake::Configure() if(genName) { m_GlobalGenerator = this->CreateGlobalGenerator(genName); + // set the global flag for unix style paths on cmSystemTools as + // soon as the generator is set. This allows gmake to be used + // on windows. + cmSystemTools::SetForceUnixPaths(m_GlobalGenerator->GetForceUnixPaths()); } else { @@ -1065,6 +1076,10 @@ int cmake::LocalGenerate() if(genName) { m_GlobalGenerator = this->CreateGlobalGenerator(genName); + // set the global flag for unix style paths on cmSystemTools as + // soon as the generator is set. This allows gmake to be used + // on windows. + cmSystemTools::SetForceUnixPaths(m_GlobalGenerator->GetForceUnixPaths()); } else { @@ -1151,10 +1166,12 @@ void cmake::AddDefaultGenerators() #if defined(_WIN32) && !defined(__CYGWIN__) m_Generators[cmGlobalVisualStudio6Generator::GetActualName()] = &cmGlobalVisualStudio6Generator::New; +#if !defined(__MINGW32__) m_Generators[cmGlobalVisualStudio7Generator::GetActualName()] = &cmGlobalVisualStudio7Generator::New; m_Generators[cmGlobalVisualStudio71Generator::GetActualName()] = &cmGlobalVisualStudio71Generator::New; +#endif m_Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] = &cmGlobalBorlandMakefileGenerator::New; m_Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] = @@ -1164,9 +1181,9 @@ void cmake::AddDefaultGenerators() m_Generators[cmGlobalCodeWarriorGenerator::GetActualName()] = &cmGlobalCodeWarriorGenerator::New; # endif +#endif m_Generators[cmGlobalUnixMakefileGenerator::GetActualName()] = &cmGlobalUnixMakefileGenerator::New; -#endif } int cmake::LoadCache() diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 69523e100..576de3421 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -38,7 +38,7 @@ #include #endif -#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__)) +#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__)) #include #include #include