diff --git a/cmake/CompileBoost.cmake b/cmake/CompileBoost.cmake index 0a90a78f83..9eba202c3c 100644 --- a/cmake/CompileBoost.cmake +++ b/cmake/CompileBoost.cmake @@ -24,10 +24,3 @@ else() add_dependencies(boost_target boostProject) target_include_directories(boost_target INTERFACE ${BOOST_INCLUDE_DIR}) endif() - -target_compile_definitions(boost_target INTERFACE BOOST_ALL_NO_LIB) -if(WIN32) - target_compile_definitions(boost_target INTERFACE BOOST_USE_WINDOWS_H BOOST_ALL_NO_LIB NOMINMAX WIN32_LEAN_AND_MEAN) -endif() -if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") -endif() diff --git a/cmake/ConfigureCompiler.cmake b/cmake/ConfigureCompiler.cmake index 1681567f99..092683e393 100644 --- a/cmake/ConfigureCompiler.cmake +++ b/cmake/ConfigureCompiler.cmake @@ -91,8 +91,8 @@ if(WIN32) # TODO: This doesn't seem to be good style, but I couldn't find a better way so far string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() - add_compile_options(/W0 /EHsc /bigobj $<$:/Zi> /FC /Gm-) - add_compile_definitions(_WIN32_WINNT=${WINDOWS_TARGET} WINVER=${WINDOWS_TARGET} NTDDI_VERSION=0x05020000) + add_compile_options(/W0 /EHsc /bigobj $<$:/Zi> /MP /FC /Gm-) + add_compile_definitions(_WIN32_WINNT=${WINDOWS_TARGET} WINVER=${WINDOWS_TARGET} NTDDI_VERSION=0x05020000 BOOST_ALL_NO_LIB) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") else() diff --git a/fdbrpc/Platform.cpp b/fdbrpc/Platform.cpp index b81316334e..a680540d53 100644 --- a/fdbrpc/Platform.cpp +++ b/fdbrpc/Platform.cpp @@ -26,6 +26,8 @@ #ifdef _WIN32 #include +#undef max +#undef min #include #include #include diff --git a/fdbserver/WorkerInterface.actor.h b/fdbserver/WorkerInterface.actor.h index 056a9c4f52..bf25285c44 100644 --- a/fdbserver/WorkerInterface.actor.h +++ b/fdbserver/WorkerInterface.actor.h @@ -154,7 +154,7 @@ struct InitializeBackupReply { LogEpoch backupEpoch; InitializeBackupReply() = default; - InitializeBackupReply(BackupInterface interf, LogEpoch e) : interf(interf), backupEpoch(e) {} + InitializeBackupReply(BackupInterface interface, LogEpoch e) : interf(interface), backupEpoch(e) {} template void serialize(Ar& ar) { diff --git a/fdbservice/FDBService.cpp b/fdbservice/FDBService.cpp index 2fba3207ba..8ad4745fbd 100644 --- a/fdbservice/FDBService.cpp +++ b/fdbservice/FDBService.cpp @@ -413,11 +413,11 @@ protected: char confFileDirectory[2048]; char *fileNameStart; if( !GetFullPathName( confFile.c_str(), 2048, confFileDirectory, &fileNameStart ) ) { - errorExit( format( "get path of conf file (%s)", confFile.c_str() ).c_str() ); + errorExit( format( "get path of conf file (%s)", confFile ).c_str() ); } if( !fileNameStart ) { - errorExit( format( "file name not present (%s)", confFile.c_str() ).c_str() ); + errorExit( format( "file name not present (%s)", confFile ).c_str() ); } // Test file existence @@ -840,7 +840,7 @@ void print_usage(const char *name) { " -h, --help Display this help and exit.\n", name); } -int main(int argc, LPCSTR *argv) { +int main(DWORD argc, LPCSTR *argv) { _set_FMA3_enable(0); // Workaround for VS 2013 code generation bug. See https://connect.microsoft.com/VisualStudio/feedback/details/811093/visual-studio-2013-rtm-c-x64-code-generation-bug-for-avx2-instructions int status = 0; diff --git a/fdbservice/ServiceBase.cpp b/fdbservice/ServiceBase.cpp index e2a8eeb046..8d27a54206 100644 --- a/fdbservice/ServiceBase.cpp +++ b/fdbservice/ServiceBase.cpp @@ -118,9 +118,9 @@ CServiceBase::CServiceBase(char *serviceName, bool fCanPauseContinue) { // Service name must be a valid string and cannot be NULL. - m_name = (serviceName == nullptr) ? const_cast("") : serviceName; + m_name = (serviceName == NULL) ? "" : serviceName; - m_statusHandle = nullptr; + m_statusHandle = NULL; // The service runs in its own process. m_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;