From 58afee8220b27f5a34f129f380f56b500da86c95 Mon Sep 17 00:00:00 2001 From: benjaminwagner Date: Wed, 18 Nov 2015 13:14:14 -0800 Subject: [PATCH] Fix GOOGLE3 Android build. DebugWriteToStderr isn't defined for Android. I'm not sure if I just didn't test compiling for Android or if this is due to a change in the base library. BUG=skia: No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/1438773003 --- include/core/SkPostConfig.h | 8 ++++++-- src/core/SkDebug.cpp | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h index b994c05cef..d23eddf2e6 100644 --- a/include/core/SkPostConfig.h +++ b/include/core/SkPostConfig.h @@ -147,16 +147,20 @@ # #endif +#if defined(GOOGLE3) + // Used as argument to DumpStackTrace in SK_ALWAYSBREAK. + void SkDebugfForDumpStackTrace(const char* data, void* unused); +#endif + #ifndef SK_ALWAYSBREAK # if defined(GOOGLE3) - void DebugWriteToStderr(const char*, void*); void DumpStackTrace(int skip_count, void w(const char*, void*), void* arg); # define SK_ALWAYSBREAK(cond) do { \ if (cond) break; \ SkNO_RETURN_HINT(); \ SkDebugf("%s:%d: failed assertion \"%s\"\n", __FILE__, __LINE__, #cond); \ - DumpStackTrace(0, DebugWriteToStderr, nullptr); \ + DumpStackTrace(0, SkDebugfForDumpStackTrace, nullptr); \ SK_CRASH(); \ } while (false) # elif defined(SK_DEBUG) diff --git a/src/core/SkDebug.cpp b/src/core/SkDebug.cpp index b705a650ea..0a3a976771 100644 --- a/src/core/SkDebug.cpp +++ b/src/core/SkDebug.cpp @@ -57,3 +57,9 @@ size_t SkToSizeT(uintmax_t x) { } #endif + +#if defined(GOOGLE3) +void SkDebugfForDumpStackTrace(const char* data, void* unused) { + SkDebugf("%s", data); +} +#endif