mdbx-windows: check _WIN32_WINNT definition.

Related to https://github.com/erthink/libmdbx/issues/155

Change-Id: I49c294bd0fa055026b742a12a6f6ea9cd805cf02
This commit is contained in:
Leonid Yuriev 2021-05-08 15:27:57 +03:00
parent ab1fc94a5b
commit 33e8b19ea4
2 changed files with 11 additions and 1 deletions

7
mdbx.h
View File

@ -616,7 +616,12 @@ extern LIBMDBX_VERINFO_API const struct MDBX_build_info {
* So, if you doubt, just build MDBX as the separate DLL and don't worry. */ * So, if you doubt, just build MDBX as the separate DLL and don't worry. */
#ifndef MDBX_CONFIG_MANUAL_TLS_CALLBACK #ifndef MDBX_CONFIG_MANUAL_TLS_CALLBACK
#if defined(_WIN32_WINNT_VISTA) && WINVER >= _WIN32_WINNT_VISTA #ifndef _WIN32_WINNT
#error Non-dll build libmdbx requires target Windows version \
to be explicitly defined via _WIN32_WINNT for properly \
handling thread local storage destructors.
#endif
#if _WIN32_WINNT >= 0x0600 /* Windows Vista */
/* As described above mdbx_dll_handler() is NOT needed forWindows Vista /* As described above mdbx_dll_handler() is NOT needed forWindows Vista
* and later. */ * and later. */
#define MDBX_CONFIG_MANUAL_TLS_CALLBACK 0 #define MDBX_CONFIG_MANUAL_TLS_CALLBACK 0

View File

@ -143,6 +143,11 @@ __extern_C key_t ftok(const char *, int);
#endif /* SunOS/Solaris */ #endif /* SunOS/Solaris */
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0601 /* Windows 7 */
#elif _WIN32_WINNT < 0x0500
#error At least 'Windows 2000' API is required for libmdbx.
#endif /* _WIN32_WINNT */
#ifndef WIN32_LEAN_AND_MEAN #ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#endif /* WIN32_LEAN_AND_MEAN */ #endif /* WIN32_LEAN_AND_MEAN */