Skip to content

Commit

Permalink
COMMON: Add STATIC_ASSERT macro to scummsys.h
Browse files Browse the repository at this point in the history
  • Loading branch information
csnover committed Jan 8, 2017
1 parent 640f603 commit 7e0b401
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions common/scummsys.h
Expand Up @@ -151,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
Expand Down

0 comments on commit 7e0b401

Please sign in to comment.