Go to the documentation of this file.
18 #ifndef ION_PORT_STATIC_ASSERT_H_
19 #define ION_PORT_STATIC_ASSERT_H_
31 #if (LANG_CXX11 || _MSC_VER >= 1600) && !defined(ION_PLATFORM_NACL)
32 #define ION_PORT_STATIC_ASSERT(expr, message) static_assert(expr, message)
40 #define ION__STATIC_ASSERT_CAT0(a, b) a ## b
41 #define ION__STATIC_ASSERT_CAT1(a, b) ION__STATIC_ASSERT_CAT0(a, b)
49 # define ION_ATTRIBUTE_UNUSED __attribute__((unused))
51 # define ION_ATTRIBUTE_UNUSED
54 #define ION_PORT_STATIC_ASSERT(expr, message) \
55 typedef int ION__STATIC_ASSERT_CAT1(static_assert_failed_at_line, __LINE__)[ \
56 static_cast<bool>(expr) ? 1 : -1] ION_ATTRIBUTE_UNUSED
62 #endif // ION_PORT_STATIC_ASSERT_H_