mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 05:28:56 +02:00
[common] remove assert extra newline (#3362)
Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3362 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: DraVee <dravee@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
c59d12b0cd
commit
2f1f9be7a4
1 changed files with 7 additions and 6 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: 2013 Dolphin Emulator Project
|
// SPDX-FileCopyrightText: 2013 Dolphin Emulator Project
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
void AssertFailSoftImpl();
|
void AssertFailSoftImpl();
|
||||||
[[noreturn]] void AssertFatalImpl();
|
[[noreturn]] void AssertFatalImpl();
|
||||||
|
|
||||||
|
// Prevents errors on old GCC... smh...
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define YUZU_NO_INLINE __declspec(noinline)
|
#define YUZU_NO_INLINE __declspec(noinline)
|
||||||
#else
|
#else
|
||||||
|
|
@ -23,9 +24,9 @@ void AssertFailSoftImpl();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ASSERT_MSG(_a_, ...) \
|
#define ASSERT_MSG(_a_, ...) \
|
||||||
([&]() YUZU_NO_INLINE { \
|
([&]() YUZU_NO_INLINE { \
|
||||||
if (!(_a_)) [[unlikely]] { \
|
if (!(_a_)) [[unlikely]] { \
|
||||||
LOG_CRITICAL(Debug, __FILE__ ": assert\n" __VA_ARGS__); \
|
LOG_CRITICAL(Debug, __FILE__ ": assert " __VA_ARGS__); \
|
||||||
AssertFailSoftImpl(); \
|
AssertFailSoftImpl(); \
|
||||||
} \
|
} \
|
||||||
}())
|
}())
|
||||||
|
|
@ -33,7 +34,7 @@ void AssertFailSoftImpl();
|
||||||
|
|
||||||
#define UNREACHABLE_MSG(...) \
|
#define UNREACHABLE_MSG(...) \
|
||||||
do { \
|
do { \
|
||||||
LOG_CRITICAL(Debug, __FILE__ ": unreachable\n" __VA_ARGS__); \
|
LOG_CRITICAL(Debug, __FILE__ ": unreachable " __VA_ARGS__); \
|
||||||
AssertFatalImpl(); \
|
AssertFatalImpl(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define UNREACHABLE() UNREACHABLE_MSG("")
|
#define UNREACHABLE() UNREACHABLE_MSG("")
|
||||||
|
|
@ -50,10 +51,10 @@ void AssertFailSoftImpl();
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define UNIMPLEMENTED() ASSERT_MSG(false, "Unimplemented code!")
|
#define UNIMPLEMENTED() ASSERT(false && "Unimplemented!")
|
||||||
#define UNIMPLEMENTED_MSG(...) ASSERT_MSG(false, __VA_ARGS__)
|
#define UNIMPLEMENTED_MSG(...) ASSERT_MSG(false, __VA_ARGS__)
|
||||||
|
|
||||||
#define UNIMPLEMENTED_IF(cond) ASSERT_MSG(!(cond), "Unimplemented code!")
|
#define UNIMPLEMENTED_IF(cond) ASSERT((!(cond)) && "Unimplemented!")
|
||||||
#define UNIMPLEMENTED_IF_MSG(cond, ...) ASSERT_MSG(!(cond), __VA_ARGS__)
|
#define UNIMPLEMENTED_IF_MSG(cond, ...) ASSERT_MSG(!(cond), __VA_ARGS__)
|
||||||
|
|
||||||
// If the assert is ignored, execute _b_
|
// If the assert is ignored, execute _b_
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue