summaryrefslogtreecommitdiff
path: root/src/stdafx.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2011-02-09 18:55:51 +0000
committersmatz <smatz@openttd.org>2011-02-09 18:55:51 +0000
commitfbfb0ffbf24b7ea2630b4b3caee63d09964da75b (patch)
tree67be7735e5e0c92c21dd572a6349b16e62d88f23 /src/stdafx.h
parent67cbee4f6476874e5a657412b9ec0033a443562f (diff)
downloadopenttd-fbfb0ffbf24b7ea2630b4b3caee63d09964da75b.tar.xz
(svn r22041) -Codechange: add a check that we called PoolItem::CanAllocateItem() before actually allocating it
Diffstat (limited to 'src/stdafx.h')
-rw-r--r--src/stdafx.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/stdafx.h b/src/stdafx.h
index 0c7507ff8..b226e44f4 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -409,6 +409,11 @@ void NORETURN CDECL error(const char *str, ...) WARN_FORMAT(1, 2);
#define assert(expression) if (!(expression)) error("Assertion failed at line %i of %s: %s", __LINE__, __FILE__, #expression);
#endif
+/* Asserts are enabled if NDEBUG isn't defined, or if we are using MSVC and WITH_ASSERT is defined. */
+#if !defined(NDEBUG) || (defined(_MSC_VER) && defined(WITH_ASSERT))
+ #define OTTD_ASSERT
+#endif
+
#if defined(MORPHOS) || defined(__NDS__) || defined(__DJGPP__)
/* MorphOS and NDS don't have C++ conformant _stricmp... */
#define _stricmp stricmp