summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Emmenlauer <mario@emmenlauer.de>2021-08-31 14:52:40 +0200
committerGitHub <noreply@github.com>2021-08-31 14:52:40 +0200
commit5b25b99cda8d24a1720e543d79dac9cfa2525449 (patch)
tree8499cdc2cf4a63088d890137f9356389bfc4a262
parent6762a907c164f09d3d3ed40283f11e745f3b68af (diff)
parent5a64c7101762535ecce0d43dce717b396748ddac (diff)
downloadthrift-5b25b99cda8d24a1720e543d79dac9cfa2525449.tar.gz
Merge pull request #2447 from BioDataAnalysis/bda_use_cmake_config_on_msvc
Use the cmake-generated thrift config also on MSVC
-rw-r--r--build/cmake/ConfigureChecks.cmake17
-rw-r--r--build/cmake/config.h.in5
-rw-r--r--lib/cpp/src/thrift/server/TNonblockingServer.cpp2
-rw-r--r--lib/cpp/src/thrift/thrift-config.h3
4 files changed, 21 insertions, 6 deletions
diff --git a/build/cmake/ConfigureChecks.cmake b/build/cmake/ConfigureChecks.cmake
index 276d8ef5e..29b8bbea8 100644
--- a/build/cmake/ConfigureChecks.cmake
+++ b/build/cmake/ConfigureChecks.cmake
@@ -21,6 +21,9 @@ include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckSymbolExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(CheckCXXSourceCompiles)
if (Inttypes_FOUND)
# This allows the inttypes.h and stdint.h checks to succeed on platforms that
@@ -52,14 +55,24 @@ check_include_file(sched.h HAVE_SCHED_H)
check_include_file(string.h HAVE_STRING_H)
check_include_file(strings.h HAVE_STRINGS_H)
+# Check for afunix.h on Windows (since Windows 10 Insider Build 17063):
+check_cxx_source_compiles(
+ "
+ #define WIN32_LEAN_AND_MEAN
+ #include <winsock2.h>
+ #include <windows.h>
+ #include <afunix.h>
+ int main(){(void)sizeof(((struct sockaddr_un *)0)->sun_path); return 0;}
+ "
+ HAVE_AF_UNIX_H)
+
+
check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
check_function_exists(gethostbyname_r HAVE_GETHOSTBYNAME_R)
check_function_exists(strerror_r HAVE_STRERROR_R)
check_function_exists(sched_get_priority_max HAVE_SCHED_GET_PRIORITY_MAX)
check_function_exists(sched_get_priority_min HAVE_SCHED_GET_PRIORITY_MIN)
-include(CheckCSourceCompiles)
-include(CheckCXXSourceCompiles)
check_cxx_source_compiles(
"
diff --git a/build/cmake/config.h.in b/build/cmake/config.h.in
index a3d66428c..afcdc1e6a 100644
--- a/build/cmake/config.h.in
+++ b/build/cmake/config.h.in
@@ -131,7 +131,10 @@
#cmakedefine HAVE_SCHED_H 1
/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
+#cmakedefine HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <afunix.h> header file. */
+#cmakedefine HAVE_AF_UNIX_H 1
/*************************** FUNCTIONS ***************************/
diff --git a/lib/cpp/src/thrift/server/TNonblockingServer.cpp b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
index ea394c804..f2b3e708b 100644
--- a/lib/cpp/src/thrift/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
@@ -1438,7 +1438,7 @@ void TNonblockingIOThread::setCurrentThreadHighPriority(bool value) {
#ifdef HAVE_SCHED_H
// Start out with a standard, low-priority setup for the sched params.
struct sched_param sp;
- bzero((void*)&sp, sizeof(sp));
+ memset(static_cast<void*>(&sp), 0, sizeof(sp));
int policy = SCHED_OTHER;
// If desired, set up high-priority sched params structure.
diff --git a/lib/cpp/src/thrift/thrift-config.h b/lib/cpp/src/thrift/thrift-config.h
index d648706c7..71da4cb99 100644
--- a/lib/cpp/src/thrift/thrift-config.h
+++ b/lib/cpp/src/thrift/thrift-config.h
@@ -19,6 +19,5 @@
#ifdef _WIN32
#include <thrift/windows/config.h>
-#else
-#include <thrift/config.h>
#endif
+#include <thrift/config.h>