From ea2cfc44c0ce91267aa87173cfd02eb1c69d3147 Mon Sep 17 00:00:00 2001 From: dhewg Date: Mon, 14 Feb 2011 17:51:58 +0100 Subject: ANDROID: Fix assert() to log output add bionic replacement __assert2(), so we actually see what's happening --- backends/platform/android/android.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'backends/platform/android') diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index d3b7697e7a..b59fc76a59 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -73,12 +73,20 @@ #undef JNIEXPORT #define JNIEXPORT __attribute__ ((visibility("default"))) -// This replaces the bionic libc assert message with something that +// This replaces the bionic libc assert functions 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); +extern "C" { + void __assert(const char *file, int line, const char *expr) { + __android_log_assert(expr, LOG_TAG, + "Assertion failure: '%s' in %s:%d", + expr, file, line); + } + + void __assert2(const char *file, int line, const char *func, const char *expr) { + __android_log_assert(expr, LOG_TAG, + "Assertion failure: '%s' in %s:%d (%s)", + expr, file, line, func); + } } static JavaVM *cached_jvm; -- cgit v1.2.3