debug: suppress nonnull-compare warnings in CHECK
This commit is contained in:
parent
654f391cba
commit
1d387ea323
24
debug.hpp
24
debug.hpp
@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "platform.hpp"
|
||||||
|
|
||||||
//#include "maths.hpp" // XXX: See notes at the end of file for maths.hpp inclusion
|
//#include "maths.hpp" // XXX: See notes at the end of file for maths.hpp inclusion
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -110,12 +112,24 @@
|
|||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
#define CHECK(C) do { \
|
#ifdef COMPILER_GCC
|
||||||
DEBUG_ONLY ( \
|
#define CHECK(C) do { \
|
||||||
if (!(C)) \
|
_Pragma("GCC diagnostic push") \
|
||||||
panic (#C); \
|
_Pragma("GCC diagnostic ignored \"-Wnonnull-compare\"") \
|
||||||
); \
|
DEBUG_ONLY ( \
|
||||||
|
if (!(C)) \
|
||||||
|
panic (#C); \
|
||||||
|
); \
|
||||||
|
_Pragma("GCC diagnostic pop") \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
#else
|
||||||
|
#define CHECK(C) do { \
|
||||||
|
DEBUG_ONLY ( \
|
||||||
|
if (!(C)) \
|
||||||
|
panic (#C); \
|
||||||
|
); \
|
||||||
|
} while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user