summaryrefslogtreecommitdiffstats
path: root/src/Globals.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-03-28 14:34:57 +0200
committerGitHub <noreply@github.com>2021-03-28 14:34:57 +0200
commit5123850db075b69272700b32314dc9b04e0b43b3 (patch)
tree35d68728a4550f760241804442c08f0e9db91484 /src/Globals.h
parentUpdate Copyright year (#5165) (diff)
downloadcuberite-5123850db075b69272700b32314dc9b04e0b43b3.tar
cuberite-5123850db075b69272700b32314dc9b04e0b43b3.tar.gz
cuberite-5123850db075b69272700b32314dc9b04e0b43b3.tar.bz2
cuberite-5123850db075b69272700b32314dc9b04e0b43b3.tar.lz
cuberite-5123850db075b69272700b32314dc9b04e0b43b3.tar.xz
cuberite-5123850db075b69272700b32314dc9b04e0b43b3.tar.zst
cuberite-5123850db075b69272700b32314dc9b04e0b43b3.zip
Diffstat (limited to 'src/Globals.h')
-rw-r--r--src/Globals.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Globals.h b/src/Globals.h
index 0a5607c2f..d5af4fa11 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -78,22 +78,24 @@
// OS-dependent stuff:
#ifdef _WIN32
-
+ #define NOMINMAX // Windows SDK defines min and max macros, messing up with our std::min and std::max usage.
#define WIN32_LEAN_AND_MEAN
- #define _WIN32_WINNT _WIN32_WINNT_WS03 // We want to target Windows XP with Service Pack 2 & Windows Server 2003 with Service Pack 1 and higher
+ #define _WIN32_WINNT 0x0501 // We want to target Windows XP with Service Pack 2 & Windows Server 2003 with Service Pack 1 and higher.
- // Windows SDK defines min and max macros, messing up with our std::min and std::max usage
- #define NOMINMAX
+ // Use CryptoAPI primitives when targeting a version that supports encrypting with AES-CFB8 smaller than a full block at a time.
+ #define PLATFORM_CRYPTOGRAPHY (_WIN32_WINNT >= 0x0602)
#include <Windows.h>
#include <winsock2.h>
#include <Ws2tcpip.h> // IPv6 stuff
- // Windows SDK defines GetFreeSpace as a constant, probably a Win16 API remnant
+ // Windows SDK defines GetFreeSpace as a constant, probably a Win16 API remnant:
#ifdef GetFreeSpace
#undef GetFreeSpace
#endif // GetFreeSpace
#else
+ #define PLATFORM_CRYPTOGRAPHY 0
+
#include <arpa/inet.h>
#include <unistd.h>
#endif