Commit 9db82895 authored by Andreas Schuh's avatar Andreas Schuh

#125 Fix unused typedef/variable warning for static assertion

parent 4e61c45e
......@@ -88,9 +88,10 @@ typedef unsigned char uint8;
// -- utility macros ---------------------------------------------------------
template <bool> struct CompileAssert {};
template <bool b> struct CompileAssert;
template <> struct CompileAssert<true> {};
#define COMPILE_ASSERT(expr, msg) \
typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
enum { assert_##msg = sizeof(CompileAssert<bool(expr)>) }
// Returns the number of elements in an array.
#define arraysize(arr) (sizeof(arr)/sizeof(*(arr)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment