mirror of
https://github.com/hyprwm/Hyprland.git
synced 2026-08-24 10:04:19 -05:00
internal: fix filename string not being computed at compile time in RASSERT and GLCALL macros (#14972)
This commit is contained in:
+3
-2
@@ -3,6 +3,7 @@
|
||||
#include <cmath>
|
||||
#include <csignal>
|
||||
#include <print>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
#include "helpers/memory/Memory.hpp"
|
||||
@@ -47,7 +48,7 @@
|
||||
if (!(expr)) { \
|
||||
Log::logger->log(Log::CRIT, "\n==========================================================================================\nASSERTION FAILED! \n\n{}\n\nat: line {} in {}", \
|
||||
std::format(reason, ##__VA_ARGS__), __LINE__, \
|
||||
([]() constexpr -> std::string { return std::string(__FILE__).substr(std::string(__FILE__).find_last_of('/') + 1); })()); \
|
||||
([]() consteval { return std::string_view(__FILE__).substr(std::string_view(__FILE__).find_last_of('/') + 1); })()); \
|
||||
std::print("Assertion failed! See the log in /tmp/hypr/hyprland.log for more info."); \
|
||||
raise(SIGABRT); \
|
||||
}
|
||||
@@ -101,7 +102,7 @@
|
||||
auto err = glGetError(); \
|
||||
if (err != GL_NO_ERROR) { \
|
||||
Log::logger->log(Log::ERR, "[GLES] Error in call at {}@{}: 0x{:x}", __LINE__, \
|
||||
([]() constexpr -> std::string { return std::string(__FILE__).substr(std::string(__FILE__).find_last_of('/') + 1); })(), err); \
|
||||
([]() consteval { return std::string_view(__FILE__).substr(std::string_view(__FILE__).find_last_of('/') + 1); })(), err); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user