summaryrefslogtreecommitdiff
path: root/src/defines.hpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-27 22:34:02 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-27 22:34:02 +0200
commit144a79ee00951ed175a9ea3ebc28eb821f855138 (patch)
tree305d8967d817d9a4f156c6ae7b978b48875195ab /src/defines.hpp
parentde8d2fd13645d12c8d05ebff1053d09b768a1939 (diff)
fixed ASSERT and last commit's oopsie
Diffstat (limited to 'src/defines.hpp')
-rw-r--r--src/defines.hpp6
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