From 003d26a2689eaabcd5886ac414fe5f649b34ce1e Mon Sep 17 00:00:00 2001 From: Tom Mason Date: Sat, 13 Jul 2024 20:44:45 +0200 Subject: [PATCH] show assert info --- EmperorHooks/Error.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/EmperorHooks/Error.hpp b/EmperorHooks/Error.hpp index 313911c..1f309e3 100644 --- a/EmperorHooks/Error.hpp +++ b/EmperorHooks/Error.hpp @@ -1,3 +1,6 @@ #pragma once -#define release_assert(X) if (!(X)) do { MessageBoxA(nullptr, "assert failed", "assert failed", 0); abort(); } while (0) \ No newline at end of file +#define RASSERT_STRINGIFY(X) #X +#define RASSERT_STRINGIFY_2(X) RASSERT_STRINGIFY(X) + +#define release_assert(X) if (!(X)) do { MessageBoxA(nullptr, "assert failed: " RASSERT_STRINGIFY(X) " at " __FILE__ ":" RASSERT_STRINGIFY_2(__LINE__), "assert failed", 0); abort(); } while (0) \ No newline at end of file