From d72ae64e3447ca01e308e61c320692463596fb0b Mon Sep 17 00:00:00 2001 From: Angus Lees Date: Tue, 8 Jun 2010 13:25:00 +0000 Subject: Provide a replacement for bionic's __assert(). The usual Android version doesn't actually print the assert message before aborting. svn-id: r49506 --- backends/platform/android/android.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'backends/platform/android/android.cpp') 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; -- cgit v1.2.3