summaryrefslogtreecommitdiff
path: root/src/stdafx.h
diff options
context:
space:
mode:
authorJonathan G Rennison <j.g.rennison@gmail.com>2016-09-05 01:18:09 +0100
committerCharles Pigott <charlespigott@googlemail.com>2020-12-27 10:30:55 +0000
commit5cf28be742581d335ecb0c270e8039ee8ed9ccf0 (patch)
tree8b6d8ea52ae97e02515031499d4e8d319fe171bb /src/stdafx.h
parenteb74179c6d66921d2946e4a93e41a5de0af4a4ac (diff)
downloadopenttd-5cf28be742581d335ecb0c270e8039ee8ed9ccf0.tar.xz
Codechange: Add support for verbose asserts
Diffstat (limited to 'src/stdafx.h')
-rw-r--r--src/stdafx.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/stdafx.h b/src/stdafx.h
index 9b9f4c6a9..00dd1322a 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -430,6 +430,9 @@ void NORETURN CDECL error(const char *str, ...) WARN_FORMAT(1, 2);
/* Asserts are enabled if NDEBUG isn't defined or WITH_ASSERT is defined. */
#if !defined(NDEBUG) || defined(WITH_ASSERT)
# define OTTD_ASSERT
+# define assert_msg(expression, msg, ...) if (!(expression)) error("Assertion failed at line %i of %s: %s\n\t" msg, __LINE__, __FILE__, #expression, __VA_ARGS__);
+#else
+# define assert_msg(expression, msg, ...)
#endif
#if defined(OPENBSD)