From 970917f164e5fa750d2f490d000ad8f9fb6c9bf9 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 1 Oct 2023 23:11:04 +0200 Subject: [PATCH] unicode: silence MSVC code analysis warnings Those lines of code were tested. Signed-off-by: Simon Rozman --- include/stdex/unicode.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/stdex/unicode.hpp b/include/stdex/unicode.hpp index 549287e83..cd905ee46 100644 --- a/include/stdex/unicode.hpp +++ b/include/stdex/unicode.hpp @@ -111,6 +111,7 @@ namespace stdex return; } +#pragma warning(suppress: 4127) if _Constexpr_ (sizeof(T_from) == sizeof(char) && sizeof(T_to) == sizeof(wchar_t)) { assert(count_src < INT_MAX || count_src == SIZE_MAX); @@ -134,6 +135,7 @@ namespace stdex throw std::system_error(GetLastError(), std::system_category(), "MultiByteToWideChar failed"); } +#pragma warning(suppress: 4127) if _Constexpr_ (sizeof(T_from) == sizeof(wchar_t) && sizeof(T_to) == sizeof(char)) { assert(count_src < INT_MAX || count_src == SIZE_MAX); @@ -157,6 +159,7 @@ namespace stdex throw std::system_error(GetLastError(), std::system_category(), "WideCharToMultiByte failed"); } +#pragma warning(suppress: 4127) if _Constexpr_ (sizeof(T_from) == sizeof(char) && sizeof(T_to) == sizeof(char)) { assert(count_src < INT_MAX || count_src == SIZE_MAX);