summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-06 15:54:10 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-06 15:54:10 +0200
commitded69f52906990cf975a62c0efbaca4b6cfa5e88 (patch)
treebca2790e5d9d45ccef12e9da6cf4b125912f12db /compat
parent896e072d8bd94020c883e994451b86675ecdced7 (diff)
a
Diffstat (limited to 'compat')
-rw-r--r--compat/assert.hpp39
1 files changed, 19 insertions, 20 deletions
diff --git a/compat/assert.hpp b/compat/assert.hpp
index a9dbe0bc..0d433274 100644
--- a/compat/assert.hpp
+++ b/compat/assert.hpp
@@ -23,30 +23,29 @@ constexpr void abort(const char (&fmt)[N], Xs... xs)
namespace Magnum::Examples {
-#define ABORT(...) \
- do { \
- if (std::is_constant_evaluated()) \
- throw "aborting"; \
- else \
- ::Magnum::Examples::detail:: \
- abort("%s: aborting at %s:%d", FUNCTION_NAME, __FILE__, __LINE__); \
+#define ABORT(fmt, ...) \
+ do { \
+ if (std::is_constant_evaluated()) \
+ throw "aborting"; \
+ else \
+ ::Magnum::Examples::detail:: abort(fmt, __VA_ARGS__); \
} while (false)
-#define ASSERT(expr) \
- do { \
- if (!(expr)) { \
- ::Magnum::Examples::detail:: \
- abort("%s: assertion failed: '%s' in %s:%d", \
- FUNCTION_NAME, #expr, __FILE__, __LINE__); \
- } \
+#define ASSERT(expr) \
+ do { \
+ if (!(expr)) { \
+ ::Magnum::Examples::detail:: \
+ abort("assertion failed: '%s' in %s:%d", \
+ #expr, __FILE__, __LINE__); \
+ } \
} while(false)
-#define GAME_DEBUG_OUT(pfx, ...) ([&]() { \
- if constexpr (sizeof((pfx)) > 1) \
- std::fputs((pfx), stderr); \
- std::fprintf(stderr, __VA_ARGS__); \
- std::fputs("\n", stderr); \
- std::fflush(stderr); \
+#define GAME_DEBUG_OUT(pfx, ...) ([&]() { \
+ if constexpr (sizeof((pfx)) > 1) \
+ std::fputs((pfx), stderr); \
+ std::fprintf(stderr, __VA_ARGS__); \
+ std::fputs("\n", stderr); \
+ std::fflush(stderr); \
}())
#define WARN(...) GAME_DEBUG_OUT("warning: ", __VA_ARGS__)