aboutsummaryrefslogtreecommitdiff
path: root/common/scummsys.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/scummsys.h')
-rw-r--r--common/scummsys.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/scummsys.h b/common/scummsys.h
index 959c67a404..6fd9be81c8 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -132,6 +132,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
+ #include <stddef.h>
#include <assert.h>
#include <ctype.h>
// MSVC does not define M_PI, M_SQRT2 and other math defines by default.
@@ -150,6 +151,17 @@
#if !defined(__SYMBIAN32__)
#include <new>
#endif
+
+ /**
+ * Generates a compile-time assertion.
+ *
+ * @param expression An expression that can be evaluated at compile time.
+ * @param message An underscore-delimited message to be presented at compile
+ * time if the expression evaluates to false.
+ */
+ #define STATIC_ASSERT(expression, message) \
+ extern int STATIC_ASSERT_##message[(expression) ? 1 : -1]; \
+ (void)(STATIC_ASSERT_##message);
#endif
// The following math constants are usually defined by the system math.h header, but