mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-17 22:27:00 +02:00
add crash::doAssert() for debug purposes
This commit is contained in:
parent
35c0af0bf3
commit
5a4960b300
2 changed files with 16 additions and 0 deletions
|
@ -11,6 +11,16 @@
|
|||
|
||||
#include "CrashHelpers.h"
|
||||
|
||||
#ifdef NDEBUG
|
||||
// undefine NDEBUG so doAssert() works for all builds
|
||||
#undef NDEBUG
|
||||
#include <assert.h>
|
||||
#define NDEBUG
|
||||
#else
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
|
||||
namespace crash {
|
||||
|
||||
class B;
|
||||
|
@ -34,6 +44,11 @@ A::~A() {
|
|||
_b->virtualFunction();
|
||||
}
|
||||
|
||||
// only use doAssert() for debug purposes
|
||||
void doAssert(bool value) {
|
||||
assert(value);
|
||||
}
|
||||
|
||||
void pureVirtualCall() {
|
||||
qCDebug(shared) << "About to make a pure virtual call";
|
||||
B b;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
namespace crash {
|
||||
|
||||
void doAssert(bool value); // works for Release
|
||||
void pureVirtualCall();
|
||||
void doubleFree();
|
||||
void nullDeref();
|
||||
|
|
Loading…
Reference in a new issue