aboutsummaryrefslogtreecommitdiff
path: root/src/common/assert.h
Commit message (Collapse)AuthorAgeFilesLines
* [common/logging] Simplify logging logic and fix issues when logging before ↵lizzie2026-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | system is created (#3688) - our logging code was bigger than spdlog itself, why???? just keep it simple - fix issues when logging before logging system is even started - removes the "initialized logging twice" issue - removes uneeded indirection in file logging - uses direct formatting instead of jumping hoopla-around the fmt::format() ressult - code duplication and dead code removal as usual I did explore dup2() but I think it's not worth the hassle I did try `fwopen()` but it's better if things are just kept as-is. there is a lot of noise because I removed a bunch of redundant files on logging and just put everything in one file now normally this wouldn't be a good idea, however consider: the complexity of logging; it's less than 500 lines... does it really need a whole subsystem?!?!?! ITS JUST LOGGING Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3688 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: DraVee <chimera@dravee.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [chore] Resolve "warning C4127: conditional expression is constant" while ↵xbzk2026-02-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | building under MSVC (#3567) NINJA REPORTS THIS SHIT ALMOST EVERY STEP! [161/863] Building CXX object src\hid_core\CMakeFiles\hid_core.dir\frontend\input_interpreter.cpp.obj D:\dev\eden\src\.\core/hle/kernel/k_auto_object.h(100): warning C4127: conditional expression is constant D:\dev\eden\src\.\core/hle/kernel/k_auto_object.h(100): note: consider using 'if constexpr' statement instead D:\dev\eden\src\.\core/hle/kernel/k_memory_manager.h(246): warning C4127: conditional expression is constant D:\dev\eden\src\.\core/hle/kernel/k_memory_manager.h(246): note: consider using 'if constexpr' statement instead The reason, any mention to UNIMPLEMENTED() macro reaches this point where a constant expression (macro argument) is not declared so. There must be several other ways to suppress, like via cmake C4127 suppression or making every source constexpr, but lazy. Since it's an unimplemented() feature assert call, i`ve just made it non constant. Covers everything. No charges. Signed-off-by: xbzk <xbzk@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3567 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: xbzk <xbzk@eden-emu.dev> Co-committed-by: xbzk <xbzk@eden-emu.dev>
* [common] remove assert extra newline (#3362)lizzie2026-01-261-6/+7
| | | | | | | | | 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>
* [common] asserts now display expression of assert (#2997)lizzie2025-12-011-30/+10
| | | | | | | | | | | | Easiest change in the world, will help to pinpoint asserts quicker, it's just a relatively small thing so doesn't even need testing. Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2997 Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [common] Do not expose platform specific Crash() macro that is only used ↵lizzie2025-11-031-10/+13
| | | | | | | | | | | | | | | | ever once (#2909) thing is only ever used once and its also platform specific... uh Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2909 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* Enable compiler optimizations and enforce x86-64-v2 on GCC/Clang (#9442)Matías Locatti2022-12-171-2/+2
| | | | | | | | | | | | | | | | | * Testing LTO (#4) * Testing LTO * clang * linux * Added the rest of Blinkhawk's optimizations * Unlikely asserts * Removing LTO from Linux builds - GCC * Removing LTO from Linux builds - Clang
* common/assert: rework ASSERT handling to avoid std::function usageLiam2022-06-131-28/+17
|
* common: Don't test ASSERT conditions inlineLiam2022-06-131-29/+29
|
* common: Change semantics of UNREACHABLE to unconditionally crashLiam2022-06-131-2/+12
|
* chore: add missing SPDX tagsAndrea Pappacoda2022-04-281-3/+3
| | | | Follow-up to 2b87305d319f0bd04da36fb96314934f37b12637
* assert: Verify formattingyzct123452021-08-051-2/+6
|
* assert: Avoid empty macrosyzct123452021-08-051-2/+2
|
* common: Move assert failure handling into a cpp file.Markus Wick2021-04-041-6/+8
| | | | | | | | | | 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.
* common/assert: Make use of C++ attribute syntaxLioncash2020-08-241-3/+4
| | | | Normalizes the syntax used for attributes
* fix clang-format and lambda captureWeiyi Wang2019-11-231-1/+2
|
* unfold UNREACHABLE implementation for dumb compilersWeiyi Wang2019-11-231-2/+2
| | | 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.
* Permit a Null Shader in case of a bad host_ptr.Fernando Sahmkow2019-04-071-0/+18
|
* common/assert: Add UNIMPLEMENTED_IF and UNIMPLEMENTED_IF_MSG for conditional ↵Lioncash2018-11-201-0/+3
| | | | | | | | | | | | | | | | | | 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.
* common/assert: Make the UNIMPLEMENTED macro properly assertLioncash2018-11-201-1/+1
| | | | | | | | 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.
* Port #3474 from CitrafearlessTobi2018-07-071-1/+1
|
* Update clang formatJames Rowe2018-07-021-3/+2
|
* Rename logging macro back to LOG_*James Rowe2018-07-021-2/+2
|
* general: Convert assertion macros over to be fmt-compatibleLioncash2018-04-271-2/+3
|
* fix macos buildMerryMage2018-01-081-1/+1
|
* Remove empty newlines in #include blocks.Emmanuel Gil Peyrot2016-09-211-2/+1
| | | | | | | This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
* Sources: Run clang-format on everything.Emmanuel Gil Peyrot2016-09-181-11/+15
|
* assert: Allow UNREACHABLE_MSG to have just one argumentSam Spilsbury2016-04-241-1/+1
|
* assert: Add _MSG variations for UNREACHABLE and UNIMPLEMENTEDSam Spilsbury2016-04-231-0/+2
|
* Common: Cleanup profiler includes.Emmanuel Gil Peyrot2015-06-281-1/+0
|
* Common: Use the log system to print assert messagesYuri Kunde Schlesner2015-05-121-7/+3
|
* Clean-up includesYuri Kunde Schlesner2015-05-061-0/+1
|
* Asserts: Use lambdas to keep assertion code away from the main code pathYuri Kunde Schlesner2015-02-181-6/+25
|
* Asserts: break/crash program, fit to style guide; log.h->assert.harchshift2015-02-101-0/+36
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.