aboutsummaryrefslogtreecommitdiff
path: root/src/common/assert.h
diff options
context:
space:
mode:
authorxbzk <xbzk@eden-emu.dev>2026-02-21 03:01:19 +0100
committercrueter <crueter@eden-emu.dev>2026-02-21 03:01:19 +0100
commitd19303883edc5d8f1e9a503a4ae6693c57fee8da (patch)
tree73b4ccf07a2aa81569da59387908349ea19769f8 /src/common/assert.h
parent5ee81a493292cf5bf5f955737efb9e75c75774e4 (diff)
[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 <xbzk@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3567 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: xbzk <xbzk@eden-emu.dev> Co-committed-by: xbzk <xbzk@eden-emu.dev>
Diffstat (limited to 'src/common/assert.h')
-rw-r--r--src/common/assert.h3
1 files changed, 2 insertions, 1 deletions
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(); \
} \