diff --git a/mfbt/Assertions.cpp b/mfbt/Assertions.cpp index 5259eb7217d7..08a73af6d65c 100644 --- a/mfbt/Assertions.cpp +++ b/mfbt/Assertions.cpp @@ -47,6 +47,10 @@ #include #endif +#ifdef ANDROID +#include +#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(); }