aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/android/android.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index f319e220cc..5d78ead6be 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -74,6 +74,14 @@
#undef JNIEXPORT
#define JNIEXPORT __attribute__ ((visibility("default")))
+// This replaces the bionic libc assert message with something that
+// actually prints the assertion failure before aborting.
+extern "C"
+void __assert(const char *file, int line, const char *expr) {
+ __android_log_assert(expr, LOG_TAG, "%s:%d: Assertion failure: %s",
+ file, line, expr);
+}
+
static JavaVM *cached_jvm;
static jfieldID FID_Event_type;
static jfieldID FID_Event_synthetic;