mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-11-14 11:22:51 +00:00
common/assert: Add UNIMPLEMENTED_IF and UNIMPLEMENTED_IF_MSG for conditional assertions
Currently, there's no way to specify if an assertion should conditionally occur due to unimplemented behavior. This is useful when something is only partially implemented (e.g. due to ongoing RE work). In particular, this would be useful within the graphics code. The rationale behind this is it allows a dev to disable unimplemented feature assertions (which can occur in an unrelated work area), while still enabling regular assertions, which act as behavior guards for conditions or states which must not occur. Previously, the only way a dev could temporarily disable asserts, was to disable the regular assertion macros, which has the downside of also disabling, well, the regular assertions which hold more sanitizing value, as opposed to unimplemented feature assertions.
This commit is contained in:
parent
aaec85df9e
commit
9dcc229dfe
|
@ -54,3 +54,6 @@ __declspec(noinline, noreturn)
|
||||||
|
|
||||||
#define UNIMPLEMENTED() ASSERT_MSG(false, "Unimplemented code!")
|
#define UNIMPLEMENTED() ASSERT_MSG(false, "Unimplemented code!")
|
||||||
#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_MSG(cond, ...) ASSERT_MSG(!(cond), __VA_ARGS__)
|
||||||
|
|
Loading…
Reference in a new issue