diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-27 22:34:02 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-27 22:34:02 +0200 |
| commit | 144a79ee00951ed175a9ea3ebc28eb821f855138 (patch) | |
| tree | 305d8967d817d9a4f156c6ae7b978b48875195ab /src/defines.hpp | |
| parent | de8d2fd13645d12c8d05ebff1053d09b768a1939 (diff) | |
fixed ASSERT and last commit's oopsie
Diffstat (limited to 'src/defines.hpp')
| -rw-r--r-- | src/defines.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/defines.hpp b/src/defines.hpp index ff7588e0..e12aa53a 100644 --- a/src/defines.hpp +++ b/src/defines.hpp @@ -26,6 +26,10 @@ #define HYPRATOM(name) {name, 0} -#define RASSERT(expr, reason) if (expr) { Debug::log(CRIT, "\n==========================================================================================\nASSERTION FAILED! \n\n%s\n\nat: line %s in %s", reason, __LINE__, __FILE__); RIP("Assertion failed! See the log in /tmp/hypr/hyprland.log for more info.");} +#define RASSERT(expr, reason) \ + if (!expr) { \ + Debug::log(CRIT, "\n==========================================================================================\nASSERTION FAILED! \n\n%s\n\nat: line %d in %s", std::string(reason).c_str(), __LINE__, ([]() constexpr->std::string { return std::string(__FILE__).substr(std::string(__FILE__).find_last_of('/') + 1); })().c_str()); \ + RIP("Assertion failed! See the log in /tmp/hypr/hyprland.log for more info."); \ + } #define ASSERT(expr) RASSERT(expr, "?")
\ No newline at end of file |
