[Base] Win-Style assertion on linux. No more forced termination while debugging
This commit is contained in:
@@ -10,10 +10,14 @@
|
|||||||
#ifndef XENIA_BASE_ASSERT_H_
|
#ifndef XENIA_BASE_ASSERT_H_
|
||||||
#define XENIA_BASE_ASSERT_H_
|
#define XENIA_BASE_ASSERT_H_
|
||||||
|
|
||||||
#include <assert.h>
|
#include <cassert>
|
||||||
|
|
||||||
#include "xenia/base/platform.h"
|
#include "xenia/base/platform.h"
|
||||||
|
|
||||||
|
#if !XE_PLATFORM_WIN32
|
||||||
|
#include <csignal>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
|
|
||||||
#define static_assert_size(type, size) \
|
#define static_assert_size(type, size) \
|
||||||
@@ -47,7 +51,16 @@ namespace xe {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
#if XE_PLATFORM_WIN32
|
||||||
#define xenia_assert assert
|
#define xenia_assert assert
|
||||||
|
#else
|
||||||
|
#define xenia_assert(expr) \
|
||||||
|
do { \
|
||||||
|
if (!(expr)) { \
|
||||||
|
raise(SIGTRAP); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#define __XENIA_EXPAND(x) x
|
#define __XENIA_EXPAND(x) x
|
||||||
#define __XENIA_ARGC(...) \
|
#define __XENIA_ARGC(...) \
|
||||||
|
|||||||
Reference in New Issue
Block a user