mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-04-13 04:38:04 +00:00
Override assert() to get messages
This commit is contained in:
parent
2aba9a5ba1
commit
b717e829a7
16
src/common.h
16
src/common.h
@ -174,6 +174,22 @@ static const char *log_end = "\n";
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
#ifdef ANDROID
|
||||
// Apparently some non-conformant Android devices (ahem, Spamsung, ahem) do not actually let me see what the assert
|
||||
// actually was before aborting/segfaulting ...
|
||||
# undef assert
|
||||
# define assert(e) \
|
||||
do { \
|
||||
if ((e)) { \
|
||||
/* ... */ \
|
||||
} else { \
|
||||
LOG( "!!! ASSERT !!! : " #e ); \
|
||||
sleep(1); \
|
||||
__assert2(__FILE__, __LINE__, __func__, #e); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#define LOG(...) \
|
||||
if (do_logging) { \
|
||||
errno = 0; \
|
||||
|
Loading…
x
Reference in New Issue
Block a user