Skip to content
Snippets Groups Projects
Commit 465a5c3e authored by Chris Peterson's avatar Chris Peterson
Browse files

Bug 743306 - Part 1: On Android, log MOZ_Assert messages to logcat because...

Bug 743306 - Part 1: On Android, log MOZ_Assert messages to logcat because stderr is directed to /dev/null. r=glandium

--HG--
extra : rebase_source : 1dda421f84116784539d6ca65fb1d9092506b0bd
parent f0a17fd2
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,10 @@
#include <signal.h>
#endif
#ifdef ANDROID
#include <android/log.h>
#endif
/* Implementations of runtime and static assertion macros for C and C++. */
extern "C" {
......@@ -83,8 +87,13 @@ MOZ_Crash()
MOZ_EXPORT_API(void)
MOZ_Assert(const char* s, const char* file, int ln)
{
#ifdef ANDROID
__android_log_print(ANDROID_LOG_FATAL, "MOZ_Assert",
"Assertion failure: %s, at %s:%d\n", s, file, ln);
#else
fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln);
fflush(stderr);
#endif
MOZ_Crash();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment