Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

[chore] Resolve "warning C4127: conditional expression is constant" while building under MSVC (#3567)

xbzkd19303883edc
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(); \
} \