Added a more verbose assertion trap

This commit is contained in:
Paul Ferrand 2019-12-15 02:13:10 +01:00
parent 965ab85f6f
commit 17bfcf2567

View file

@ -30,22 +30,25 @@
// Break in source code // Break in source code
#if (__x86_64__ || __i386__) #if (__x86_64__ || __i386__)
#define ASSERTFALSE \ #define ASSERTFALSE \
{ \ { \
__asm__("int3"); \ std::cerr << "Assert failed at " << __FILE__ << ":" << __LINE__ << '\n'; \
__asm__("int3"); \
} }
#elif (__arm__ || __aarch64__) #elif (__arm__ || __aarch64__)
#define ASSERTFALSE \ #define ASSERTFALSE \
{ \ { \
__builtin_trap(); \ std::cerr << "Assert failed at " << __FILE__ << ":" << __LINE__ << '\n'; \
__builtin_trap(); \
} }
#endif #endif
#elif (_WIN32 || _WIN64) #elif (_WIN32 || _WIN64)
#pragma intrinsic(__debugbreak) #pragma intrinsic(__debugbreak)
#define ASSERTFALSE \ #define ASSERTFALSE \
{ \ { \
__debugbreak(); \ std::cerr << "Assert failed at " << __FILE__ << ":" << __LINE__ << '\n'; \
__debugbreak(); \
} }
#else #else
#define ASSERTFALSE #define ASSERTFALSE