mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-05-12 16:09:42 -06:00
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:
parent
6d0318a840
commit
5bfec866b1
@ -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 { \
|
||||
|
||||
Loading…
Reference in New Issue
Block a user