summaryrefslogtreecommitdiff
path: root/lib/cpp/src/thrift
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cpp/src/thrift')
-rw-r--r--lib/cpp/src/thrift/transport/TPipeServer.cpp1
-rw-r--r--lib/cpp/src/thrift/transport/TPipeServer.h3
-rw-r--r--lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h1
-rw-r--r--lib/cpp/src/thrift/windows/Sync.h6
4 files changed, 7 insertions, 4 deletions
diff --git a/lib/cpp/src/thrift/transport/TPipeServer.cpp b/lib/cpp/src/thrift/transport/TPipeServer.cpp
index 1d7577fbe..e4234b180 100644
--- a/lib/cpp/src/thrift/transport/TPipeServer.cpp
+++ b/lib/cpp/src/thrift/transport/TPipeServer.cpp
@@ -26,6 +26,7 @@
#ifdef _WIN32
#include <thrift/windows/OverlappedSubmissionThread.h>
+#include <thrift/windows/Sync.h>
#include <AccCtrl.h>
#include <Aclapi.h>
#include <sddl.h>
diff --git a/lib/cpp/src/thrift/transport/TPipeServer.h b/lib/cpp/src/thrift/transport/TPipeServer.h
index 67c5d51a7..249591e09 100644
--- a/lib/cpp/src/thrift/transport/TPipeServer.h
+++ b/lib/cpp/src/thrift/transport/TPipeServer.h
@@ -25,9 +25,6 @@
#ifndef _WIN32
#include <thrift/transport/TServerSocket.h>
#endif
-#ifdef _WIN32
-#include <thrift/windows/Sync.h>
-#endif
#define TPIPE_SERVER_MAX_CONNS_DEFAULT PIPE_UNLIMITED_INSTANCES
diff --git a/lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h b/lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h
index 6cecfc357..057f623b9 100644
--- a/lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h
+++ b/lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h
@@ -26,7 +26,6 @@
#include <thrift/windows/Sync.h>
#include <thrift/TNonCopyable.h>
-#include <Windows.h>
/*
*** Why does this class exist?
diff --git a/lib/cpp/src/thrift/windows/Sync.h b/lib/cpp/src/thrift/windows/Sync.h
index b1c83ee45..f5b8a052d 100644
--- a/lib/cpp/src/thrift/windows/Sync.h
+++ b/lib/cpp/src/thrift/windows/Sync.h
@@ -27,7 +27,13 @@
#include <thrift/concurrency/Exception.h>
#include <thrift/TNonCopyable.h>
+// Including Windows.h can conflict with Winsock2 usage, and also
+// adds problematic macros like min() and max(). Try to work around:
+#define NOMINMAX
+#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
+#undef NOMINMAX
+#undef WIN32_LEAN_AND_MEAN
/*
Lightweight synchronization objects that only make sense on Windows. For cross-platform