From d19303883edc5d8f1e9a503a4ae6693c57fee8da Mon Sep 17 00:00:00 2001 From: xbzk Date: Sat, 21 Feb 2026 03:01:19 +0100 Subject: [PATCH] [chore] Resolve "warning C4127: conditional expression is constant" while building under MSVC (#3567) NINJA REPORTS THIS SHIT ALMOST EVERY STEP! [161/863] Building CXX object src\hid_core\CMakeFiles\hid_core.dir\frontend\input_interpreter.cpp.obj D:\dev\eden\src\.\core/hle/kernel/k_auto_object.h(100): warning C4127: conditional expression is constant D:\dev\eden\src\.\core/hle/kernel/k_auto_object.h(100): note: consider using 'if constexpr' statement instead D:\dev\eden\src\.\core/hle/kernel/k_memory_manager.h(246): warning C4127: conditional expression is constant D:\dev\eden\src\.\core/hle/kernel/k_memory_manager.h(246): note: consider using 'if constexpr' statement instead The reason, any mention to UNIMPLEMENTED() macro reaches this point where a constant expression (macro argument) is not declared so. There must be several other ways to suppress, like via cmake C4127 suppression or making every source constexpr, but lazy. Since it's an unimplemented() feature assert call, i`ve just made it non constant. Covers everything. No charges. Signed-off-by: xbzk Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3567 Reviewed-by: Lizzie Reviewed-by: DraVee Reviewed-by: CamilleLaVey Co-authored-by: xbzk Co-committed-by: xbzk --- src/common/assert.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/assert.h b/src/common/assert.h index f720f90f15..67310f8e06 100644 --- a/src/common/assert.h +++ b/src/common/assert.h @@ -25,7 +25,8 @@ void AssertFailSoftImpl(); #define ASSERT_MSG(_a_, ...) \ ([&]() YUZU_NO_INLINE { \ - if (!(_a_)) [[unlikely]] { \ + auto&& assert_condition = (_a_); \ + if (!(assert_condition)) [[unlikely]] { \ LOG_CRITICAL(Debug, __FILE__ ": assert " __VA_ARGS__); \ AssertFailSoftImpl(); \ } \