Commit Graph

23 Commits (42d8e08f7847af3b8e8ceea14ad7193fdbdf53ef)

Author SHA1 Message Date
yzct12345 7e846be376
assert: Verify formatting 4 years ago
yzct12345 346149dcf9
assert: Avoid empty macros 4 years ago
Markus Wick 9be819faaf common: Move assert failure handling into a cpp file.
Advantage: Altering the handler does not need a full recompilation.
Disadvantage: noreturn is droped, so the caller is a bit slower.

We quite often run yuzu with a YOLO assertion handler. In fact, only very few
games run at all with asserts. This patch allows developers to patch the handler
without recompiling everything. The overhead of the missing "noreturn" attribute
shoul be negletable.
4 years ago
Lioncash 3bfaabdbdd common/assert: Make use of C++ attribute syntax
Normalizes the syntax used for attributes
5 years ago
Weiyi Wang 49e0a30dbd fix clang-format and lambda capture 5 years ago
Weiyi Wang 9a60d8a430 unfold UNREACHABLE implementation for dumb compilers
We relies on UNREACHABLE's noreturn attribute to eliminate parent's "no return value" warning. However, this was wrapped in a `if(!false)` block, which compilers may not unfold to recognize the noreturn nature.
5 years ago
Fernando Sahmkow 021cd56bc9 Permit a Null Shader in case of a bad host_ptr. 6 years ago
Lioncash 9dcc229dfe 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.
6 years ago
Lioncash aaec85df9e common/assert: Make the UNIMPLEMENTED macro properly assert
Currently, this was only performing a logging call, which doesn't
actually invoke any assertion behavior. This is unlike
UNIMPLEMENTED_MSG, which *does* assert.

This makes the expected behavior uniform across both macros.
6 years ago
fearlessTobi 476e0fae4c Port #3474 from Citra 7 years ago
James Rowe 0d46f0df12 Update clang format 7 years ago
James Rowe 638956aa81 Rename logging macro back to LOG_* 7 years ago
Lioncash 8475496630
general: Convert assertion macros over to be fmt-compatible 7 years ago
MerryMage f10a304ecd fix macos build 7 years ago
Emmanuel Gil Peyrot ebdae19fd2 Remove empty newlines in #include blocks.
This makes clang-format useful on those.

Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
9 years ago
Emmanuel Gil Peyrot dc8479928c Sources: Run clang-format on everything. 9 years ago
Sam Spilsbury ef6873980e assert: Allow UNREACHABLE_MSG to have just one argument 9 years ago
Sam Spilsbury 205e8f9f9e assert: Add _MSG variations for UNREACHABLE and UNIMPLEMENTED 9 years ago
Emmanuel Gil Peyrot 3a771a13dc Common: Cleanup profiler includes. 10 years ago
Yuri Kunde Schlesner c8eae338a8 Common: Use the log system to print assert messages 10 years ago
Yuri Kunde Schlesner c0eaa662d4 Clean-up includes 10 years ago
Yuri Kunde Schlesner 714d507938 Asserts: Use lambdas to keep assertion code away from the main code path 10 years ago
archshift ef24e72b26 Asserts: break/crash program, fit to style guide; log.h->assert.h
Involves making asserts use printf instead of the log functions (log functions are asynchronous and, as such, the log won't be printed in time)
As such, the log type argument was removed (printf obviously can't use it, and it's made obsolete by the file and line printing)

Also removed some GEKKO cruft.
10 years ago