diff options
author | Mario Emmenlauer <mario@emmenlauer.de> | 2020-05-21 23:04:12 +0200 |
---|---|---|
committer | Mario Emmenlauer <memmenlauer@biodataanalysis.de> | 2021-09-02 08:53:36 +0200 |
commit | 034c9359e978d2465f0ce8530f62c146ef18e935 (patch) | |
tree | e346bf2014f67a438c0744ae8b6edca1c313ce30 /lib/cpp/src/thrift/windows | |
parent | b8069cbe9c83a2ac094a91c5bc59a545caabb652 (diff) | |
download | thrift-034c9359e978d2465f0ce8530f62c146ef18e935.tar.gz |
Reduce the usage of Windows.h, and add macros to slim Windows.h
Diffstat (limited to 'lib/cpp/src/thrift/windows')
-rw-r--r-- | lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h | 1 | ||||
-rw-r--r-- | lib/cpp/src/thrift/windows/Sync.h | 6 |
2 files changed, 6 insertions, 1 deletions
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 |