debug: suppress nonnull-compare warnings in CHECK

This commit is contained in:
Danny Robson 2019-05-04 11:32:59 +10:00
parent 654f391cba
commit 1d387ea323

View File

@ -8,6 +8,8 @@
#pragma once
#include "platform.hpp"
//#include "maths.hpp" // XXX: See notes at the end of file for maths.hpp inclusion
#include <cmath>
#include <algorithm>
@ -110,12 +112,24 @@
///////////////////////////////////////////////////////////////////////////////
#define CHECK(C) do { \
DEBUG_ONLY ( \
if (!(C)) \
panic (#C); \
); \
#ifdef COMPILER_GCC
#define CHECK(C) do { \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wnonnull-compare\"") \
DEBUG_ONLY ( \
if (!(C)) \
panic (#C); \
); \
_Pragma("GCC diagnostic pop") \
} while (0)
#else
#define CHECK(C) do { \
DEBUG_ONLY ( \
if (!(C)) \
panic (#C); \
); \
} while (0)
#endif
///////////////////////////////////////////////////////////////////////////////