diff --git a/CMakeLists.txt b/CMakeLists.txt index bc0461d7..d41686bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -340,10 +340,12 @@ if(NOT DEFINED MDBX_CXX_STANDARD) set(MDBX_CXX_STANDARD 98) endif() endif() -if(NOT HAS_C11 LESS 0) - set(MDBX_C_STANDARD 11) -else() +# MSVC >= 19.28 (Microsoft Visual Studio 16.8) is mad! +# It unable process Windows SDK headers in the C11 mode! +if(HAS_C11 LESS 0 OR (MSVC AND MSVC_VERSION GREATER 1927)) set(MDBX_C_STANDARD 99) +else() + set(MDBX_C_STANDARD 11) endif() if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND EXISTS "${MDBX_SOURCE_DIR}/ntdll.def")