diff --git a/debug.hpp b/debug.hpp index bc9dbeb0..4265f3f1 100644 --- a/debug.hpp +++ b/debug.hpp @@ -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 #include @@ -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 ///////////////////////////////////////////////////////////////////////////////