From 0a5e412541937ead88377cabdb565ecfe65c0afc Mon Sep 17 00:00:00 2001 From: Mel Date: Thu, 15 Feb 2024 11:18:17 +0100 Subject: Give all threads specific thread roles and assert thread safety --- src/Common/Assert.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Common/Assert.hpp') diff --git a/src/Common/Assert.hpp b/src/Common/Assert.hpp index 9fc84ce..d30e724 100644 --- a/src/Common/Assert.hpp +++ b/src/Common/Assert.hpp @@ -1,6 +1,8 @@ #pragma once #include +#include +#include // https://stackoverflow.com/a/26100478/11342122 // Two levels are needed to make sure that the argument is expanded before stringification @@ -12,8 +14,8 @@ #define _ASSERT_STOP (_ASSERT_IS_DEFINED(NDEBUG) ? std::abort() : (void)raise(SIGTRAP)) // Assertion message macros, with optional message -#define _ASSERT_NOTIFY_NO_MESSAGE(start) std::fprintf(stderr, start ".\n", __FILE__, __LINE__) -#define _ASSERT_NOTIFY_WITH_MESSAGE(start, message) std::fprintf(stderr, start ": %s\n", __FILE__, __LINE__, message "") +#define _ASSERT_NOTIFY_NO_MESSAGE(start) fprintf(stderr, start ".\n", __FILE__, __LINE__) +#define _ASSERT_NOTIFY_WITH_MESSAGE(start, message) fprintf(stderr, start ": %s\n", __FILE__, __LINE__, message "") #define _ASSERT_NOTIFY(start, ...) ((strcmp(__VA_ARGS__ "", "") == 0) ? _ASSERT_NOTIFY_NO_MESSAGE(start) : _ASSERT_NOTIFY_WITH_MESSAGE(start, __VA_ARGS__)) // Debuggable assertion macro, with optional message -- cgit 1.4.1