From 0572d360240fde257dc54925c43bd3b549bc2080 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Mon, 29 Jun 2026 13:48:51 +0900 Subject: [PATCH] [CRT][UCRT][MSVCRT] intrinsic functions: Follow-up of #9157 (#9226) JIRA issue: CORE-20617 @learn-more found #9157 breaks the build as follows: > error C2220: the following warning is treated as an error > warning C4163: 'strncmp': not available as an intrinsic function > warning C4163: 'strncpy': not available as an intrinsic function _MSC_VER=1932 was not the version that the intrinsic functions (strncmp, strncpy, wcsncmp, wcsncpy) added. Using Compiler Explorer could detect the correct version: _MSC_VER=1950. --- dll/win32/msvcrt/string.c | 2 +- dll/win32/msvcrt/wcs.c | 2 +- sdk/lib/crt/string/tcsncmp.h | 2 +- sdk/lib/crt/string/tcsncpy.h | 2 +- sdk/lib/ucrt/string/strncmp.c | 2 +- sdk/lib/ucrt/string/strncpy.c | 2 +- sdk/lib/ucrt/string/wcsncmp.cpp | 2 +- sdk/lib/ucrt/string/wcsncpy.cpp | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dll/win32/msvcrt/string.c b/dll/win32/msvcrt/string.c index 5eca436fb8b..b586c3d0b60 100644 --- a/dll/win32/msvcrt/string.c +++ b/dll/win32/msvcrt/string.c @@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); #ifdef _MSC_VER #pragma function(_strset,memchr,memcmp,memcpy,memset,strcat,strcmp,strcpy,strlen) #ifdef __REACTOS__ -#if defined(_M_ARM) || _MSC_VER >= 1932 // VS2022 version 17.2 and later +#if defined(_M_ARM) || _MSC_VER >= 1950 #pragma function(strncmp,strncpy) #endif #endif diff --git a/dll/win32/msvcrt/wcs.c b/dll/win32/msvcrt/wcs.c index d42c5d43ab6..4b6993a9e37 100644 --- a/dll/win32/msvcrt/wcs.c +++ b/dll/win32/msvcrt/wcs.c @@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); #ifdef _MSC_VER #pragma function(_wcsset,wcscat,wcscmp,wcscpy,wcslen) #ifdef __REACTOS__ -#if defined(_M_ARM) || _MSC_VER >= 1932 // VS2022 version 17.2 and later +#if defined(_M_ARM) || _MSC_VER >= 1950 #pragma function(wcsncmp,wcsncpy) #endif #endif diff --git a/sdk/lib/crt/string/tcsncmp.h b/sdk/lib/crt/string/tcsncmp.h index fbf0e2ae356..5f948394307 100644 --- a/sdk/lib/crt/string/tcsncmp.h +++ b/sdk/lib/crt/string/tcsncmp.h @@ -2,7 +2,7 @@ #include #include -#if defined(_MSC_VER) && (defined(_M_ARM) || _MSC_VER >= 1932) // VS2022 version 17.2 and later +#if defined(_MSC_VER) && (defined(_M_ARM) || _MSC_VER >= 1950) #pragma function(_tcsncmp) #endif /* _MSC_VER */ diff --git a/sdk/lib/crt/string/tcsncpy.h b/sdk/lib/crt/string/tcsncpy.h index e70a7497fff..45c3f418657 100644 --- a/sdk/lib/crt/string/tcsncpy.h +++ b/sdk/lib/crt/string/tcsncpy.h @@ -2,7 +2,7 @@ #include #include -#if defined(_MSC_VER) && (defined(_M_ARM) || _MSC_VER >= 1932) // VS2022 version 17.2 and later +#if defined(_MSC_VER) && (defined(_M_ARM) || _MSC_VER >= 1950) #pragma function(_tcsncpy) #endif /* _MSC_VER */ diff --git a/sdk/lib/ucrt/string/strncmp.c b/sdk/lib/ucrt/string/strncmp.c index 85bc18c851a..2d4d595fd94 100644 --- a/sdk/lib/ucrt/string/strncmp.c +++ b/sdk/lib/ucrt/string/strncmp.c @@ -11,7 +11,7 @@ #include -#if defined(_MSC_VER) && (defined(_M_ARM) || _MSC_VER >= 1932) // VS2022 version 17.2 and later +#if defined(_MSC_VER) && (defined(_M_ARM) || _MSC_VER >= 1950) #pragma function(strncmp) #endif diff --git a/sdk/lib/ucrt/string/strncpy.c b/sdk/lib/ucrt/string/strncpy.c index 7aa0344b310..e6990ca28f2 100644 --- a/sdk/lib/ucrt/string/strncpy.c +++ b/sdk/lib/ucrt/string/strncpy.c @@ -10,7 +10,7 @@ #include -#if defined(_MSC_VER) && (defined(_M_ARM) || _MSC_VER >= 1932) // VS2022 version 17.2 and later +#if defined(_MSC_VER) && (defined(_M_ARM) || _MSC_VER >= 1950) #pragma function(strncpy) #endif diff --git a/sdk/lib/ucrt/string/wcsncmp.cpp b/sdk/lib/ucrt/string/wcsncmp.cpp index 3e464c6b12c..c66b39723bd 100644 --- a/sdk/lib/ucrt/string/wcsncmp.cpp +++ b/sdk/lib/ucrt/string/wcsncmp.cpp @@ -19,7 +19,7 @@ -#if defined(_MSC_VER) && (defined(_M_ARM) || _MSC_VER >= 1932) // VS2022 version 17.2 and later +#if defined(_MSC_VER) && (defined(_M_ARM) || _MSC_VER >= 1950) #pragma function(wcsncmp) #endif diff --git a/sdk/lib/ucrt/string/wcsncpy.cpp b/sdk/lib/ucrt/string/wcsncpy.cpp index cdbb8abd1dd..08e671d7c0c 100644 --- a/sdk/lib/ucrt/string/wcsncpy.cpp +++ b/sdk/lib/ucrt/string/wcsncpy.cpp @@ -12,7 +12,7 @@ #pragma warning(disable:__WARNING_POSTCONDITION_NULLTERMINATION_VIOLATION) // 26036 -#if defined(_MSC_VER) && (defined(_M_ARM) || _MSC_VER >= 1932) // VS2022 version 17.2 and later +#if defined(_MSC_VER) && (defined(_M_ARM) || _MSC_VER >= 1950) #pragma function(wcsncpy) #endif