diff --git a/lib/cpp/src/thrift/transport/TNonblockingServerSocket.cpp b/lib/cpp/src/thrift/transport/TNonblockingServerSocket.cpp index 0e59ae47eb8..1621bbef5a5 100644 --- a/lib/cpp/src/thrift/transport/TNonblockingServerSocket.cpp +++ b/lib/cpp/src/thrift/transport/TNonblockingServerSocket.cpp @@ -68,6 +68,10 @@ #endif // _WIN32 #endif +#if _WIN32 +#include +#endif + template inline const SOCKOPT_CAST_T* const_cast_sockopt(const T* v) { return reinterpret_cast(v); diff --git a/lib/cpp/src/thrift/transport/TServerSocket.cpp b/lib/cpp/src/thrift/transport/TServerSocket.cpp index b0c9aeb8ace..26143c193e1 100644 --- a/lib/cpp/src/thrift/transport/TServerSocket.cpp +++ b/lib/cpp/src/thrift/transport/TServerSocket.cpp @@ -76,6 +76,7 @@ #include #undef NOMINMAX #undef WIN32_LEAN_AND_MEAN +#include #endif template diff --git a/lib/cpp/src/thrift/transport/TSocket.cpp b/lib/cpp/src/thrift/transport/TSocket.cpp index 97ca746e3ee..892a4bf610e 100644 --- a/lib/cpp/src/thrift/transport/TSocket.cpp +++ b/lib/cpp/src/thrift/transport/TSocket.cpp @@ -63,6 +63,10 @@ #endif // _WIN32 #endif +#if _WIN32 +#include +#endif + template inline const SOCKOPT_CAST_T* const_cast_sockopt(const T* v) { return reinterpret_cast(v); diff --git a/lib/cpp/src/thrift/windows/config.h b/lib/cpp/src/thrift/windows/config.h index 19296d63f30..2fc6458f009 100644 --- a/lib/cpp/src/thrift/windows/config.h +++ b/lib/cpp/src/thrift/windows/config.h @@ -52,7 +52,6 @@ #include #include #include -#include #include #include diff --git a/lib/cpp/test/CMakeLists.txt b/lib/cpp/test/CMakeLists.txt index 31acf124404..3ed1d202668 100644 --- a/lib/cpp/test/CMakeLists.txt +++ b/lib/cpp/test/CMakeLists.txt @@ -67,6 +67,11 @@ set(testgencpp_cob_SOURCES ) add_library(testgencpp_cob STATIC ${testgencpp_cob_SOURCES}) +if (WIN32 AND MSVC) + add_library(testgencppCLI STATIC ${testgencpp_SOURCES}) + set_target_properties(testgencppCLI PROPERTIES COMMON_LANGUAGE_RUNTIME "") +endif() + add_executable(Benchmark Benchmark.cpp) target_link_libraries(Benchmark testgencpp) target_link_libraries(Benchmark thrift)