OLD | NEW |
---|---|
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | 2 |
3 /* This Source Code Form is subject to the terms of the Mozilla Public | 3 /* This Source Code Form is subject to the terms of the Mozilla Public |
4 * License, v. 2.0. If a copy of the MPL was not distributed with this | 4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | 6 |
7 #include "primpl.h" | 7 #include "primpl.h" |
8 #include "prenv.h" | 8 #include "prenv.h" |
9 #include "prprf.h" | 9 #include "prprf.h" |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
530 _PUT_LOG(logFile, logBuf, logp - logBuf); | 530 _PUT_LOG(logFile, logBuf, logp - logBuf); |
531 logp = logBuf; | 531 logp = logBuf; |
532 } | 532 } |
533 _PR_UNLOCK_LOG(); | 533 _PR_UNLOCK_LOG(); |
534 } | 534 } |
535 } | 535 } |
536 | 536 |
537 PR_IMPLEMENT(void) PR_Abort(void) | 537 PR_IMPLEMENT(void) PR_Abort(void) |
538 { | 538 { |
539 PR_LogPrint("Aborting"); | 539 PR_LogPrint("Aborting"); |
540 #ifdef ANDROID | |
wtc
2015/03/19 00:58:21
Can you make sure the ANDROID macro is either a pr
| |
541 __android_log_write(ANDROID_LOG_ERROR, "PRLog", "Aborting"); | |
542 #endif | |
540 abort(); | 543 abort(); |
541 } | 544 } |
542 | 545 |
543 PR_IMPLEMENT(void) PR_Assert(const char *s, const char *file, PRIntn ln) | 546 PR_IMPLEMENT(void) PR_Assert(const char *s, const char *file, PRIntn ln) |
544 { | 547 { |
545 PR_LogPrint("Assertion failure: %s, at %s:%d\n", s, file, ln); | 548 PR_LogPrint("Assertion failure: %s, at %s:%d\n", s, file, ln); |
546 fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln); | 549 fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln); |
547 fflush(stderr); | 550 fflush(stderr); |
548 #ifdef WIN32 | 551 #ifdef WIN32 |
549 DebugBreak(); | 552 DebugBreak(); |
550 #endif | 553 #elif defined(XP_OS2) |
551 #ifdef XP_OS2 | |
552 asm("int $3"); | 554 asm("int $3"); |
555 #elif defined(ANDROID) | |
556 __android_log_assert(NULL, "PRLog", "Assertion failure: %s, at %s:%d\n", | |
557 s, file, ln); | |
553 #endif | 558 #endif |
554 abort(); | 559 abort(); |
555 } | 560 } |
OLD | NEW |