From c60aea41a21fa36503c0c364c3974908e25d8969 Mon Sep 17 00:00:00 2001 From: Snesnopic Date: Wed, 20 May 2026 23:02:24 +0200 Subject: [PATCH 1/2] Check for _MSVC_LANG version instead of just __cplusplus --- src/types.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types.hpp b/src/types.hpp index 0c87a40c..b4aa9269 100644 --- a/src/types.hpp +++ b/src/types.hpp @@ -28,7 +28,7 @@ limitations under the License. typedef unsigned __int64 uint64_t; typedef __int64 int64_t; #else - #if __cplusplus >= 201103L + #if (__cplusplus >= 201103L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) // C++11 or later #include #include @@ -206,7 +206,7 @@ limitations under the License. namespace kanzi { -#if __cplusplus >= 201703L +#if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) using byte = std::byte; #else typedef uint8_t byte; From 283f4abbd23ab6fa1d69af7f635574e338fc0151 Mon Sep 17 00:00:00 2001 From: Snesnopic Date: Thu, 21 May 2026 07:44:39 +0200 Subject: [PATCH 2/2] When definind __x86_64__, properly check that we are on x64 --- src/types.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types.hpp b/src/types.hpp index b4aa9269..80584212 100644 --- a/src/types.hpp +++ b/src/types.hpp @@ -45,10 +45,10 @@ limitations under the License. #define snprintf _snprintf #endif - #if !defined(__x86_64__) + #if defined(_M_X64) && !defined(__x86_64__) #define __x86_64__ _M_X64 #endif - #if !defined(__i386__) + #if defined(_M_IX86) && !defined(__i386__) #define __i386__ _M_IX86 #endif #endif