summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-12-06 17:28:19 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-06 17:28:19 +0300
commit60497e4a95836f3a6989d1cac940fd962224172c (patch)
tree67cb2529c39c8a8ad2d062b8a1092fc70ba60b09 /src/common
parentcea55140cc2b5d1012813f8abc028ba04bd625c6 (diff)
parentd7d6e7214cc1af22dab0b28fdde218ea7d37f05f (diff)
downloadhercules-60497e4a95836f3a6989d1cac940fd962224172c.tar.gz
hercules-60497e4a95836f3a6989d1cac940fd962224172c.tar.bz2
hercules-60497e4a95836f3a6989d1cac940fd962224172c.tar.xz
hercules-60497e4a95836f3a6989d1cac940fd962224172c.zip
Merge pull request #905 from HerculesWS/races-fix
Races fix
Diffstat (limited to 'src/common')
-rw-r--r--src/common/nullpo.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/common/nullpo.h b/src/common/nullpo.h
index 52e9fba39..8abeb4af9 100644
--- a/src/common/nullpo.h
+++ b/src/common/nullpo.h
@@ -27,10 +27,23 @@
#include <crtdbg.h>
#endif // !DEFCPP && WIN && !MINGW
#define Assert(EX) assert(EX)
+/**
+ * Reports an assertion failure if the passed expression is false.
+ *
+ * @param EX The expression to test.
+ * @return false if the passed expression is true, false otherwise.
+ */
#define Assert_chk(EX) ( (EX) ? false : (nullpo->assert_report(__FILE__, __LINE__, __func__, #EX, "failed assertion"), true) )
+/**
+ * Reports an assertion failure (without actually checking it).
+ *
+ * @param EX the expression to report.
+ */
+#define Assert_report(EX) (nullpo->assert_report(__FILE__, __LINE__, __func__, #EX, "failed assertion"))
#else // ! ASSERT_CHECK
#define Assert(EX) (EX)
#define Assert_chk(EX) ((EX), false)
+#define Assert_report(EX) ((void)(EX))
#endif // ASSERT_CHECK
#if defined(NULLPO_CHECK)