Change ASSERT macros to be do while loops instead of lambdas to preserve original function names in the log (#4337)

* Change ASSERT macros to be do while loops instead of lambdas to preserve original function names in the log

* copyright 2026
This commit is contained in:
kalaposfos13 2026-04-30 18:42:54 +02:00 committed by GitHub
parent 6d0318a840
commit 5bfec866b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,6 @@
// SPDX-FileCopyrightText: 2013 Dolphin Emulator Project
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
@ -20,20 +21,20 @@ void assert_fail_impl();
#endif
#define ASSERT(_a_) \
([&]() SHAD_NO_INLINE { \
do { \
if (!(_a_)) [[unlikely]] { \
LOG_CRITICAL(Debug, "Assertion Failed!"); \
assert_fail_impl(); \
} \
}())
} while (false)
#define ASSERT_MSG(_a_, ...) \
([&]() SHAD_NO_INLINE { \
do { \
if (!(_a_)) [[unlikely]] { \
LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); \
assert_fail_impl(); \
} \
}())
} while (false)
#define UNREACHABLE() \
do { \