This commit is contained in:
Vladimir Kozlov 2013-09-05 11:04:39 -07:00
commit 1a700c9216
1322 changed files with 52051 additions and 19966 deletions

View file

@ -225,6 +225,22 @@ void report_untested(const char* file, int line, const char* message);
void warning(const char* format, ...);
#ifdef ASSERT
// Compile-time asserts.
template <bool> struct StaticAssert;
template <> struct StaticAssert<true> {};
// Only StaticAssert<true> is defined, so if cond evaluates to false we get
// a compile time exception when trying to use StaticAssert<false>.
#define STATIC_ASSERT(cond) \
do { \
StaticAssert<(cond)> DUMMY_STATIC_ASSERT; \
(void)DUMMY_STATIC_ASSERT; /* ignore */ \
} while (false)
#else
#define STATIC_ASSERT(cond)
#endif
// out of shared space reporting
enum SharedSpaceType {
SharedPermGen,