Rick van Vonderen
5 years ago
7 changed files with 83 additions and 34 deletions
@ -0,0 +1,27 @@
|
||||
#ifndef CORE_H |
||||
#define CORE_H |
||||
|
||||
#include <csignal> |
||||
|
||||
// Debugging defines
|
||||
#ifndef NDEBUG |
||||
#define NF_ENABLE_ASSERTS |
||||
#endif |
||||
|
||||
// Asserts
|
||||
#ifdef NF_ENABLE_ASSERTS |
||||
// Check if SIGTRAP is available
|
||||
#ifdef SIGTRAP |
||||
#define ABORT_SIGNAL SIGTRAP |
||||
#else |
||||
#define ABORT_SIGNAL SIGABRT |
||||
#endif |
||||
|
||||
#define NF_ASSERT(x, y) if(!(x)) { NF_DANGER(y); raise(ABORT_SIGNAL); } |
||||
#define NF_CORE_ASSERT(x, y) if(!(x)) { NF_CORE_DANGER(y); raise(ABORT_SIGNAL); } |
||||
#else |
||||
#define NF_ASSERT(x, y) |
||||
#define NF_CORE_ASSERT(x, y) |
||||
#endif |
||||
|
||||
#endif // CORE_H
|
Loading…
Reference in new issue