aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2017-05-11 09:12:57 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-11 13:48:17 +0000
commita9d9ab368318cd948ca6ce2796f69ef95e7c1f1a (patch)
treea57a1ea2bf8ca54e32e11482efbd410926488812
parentb60acfcfacdd5631f449fc0b8e8bec4396fa2fa5 (diff)
fix SkASSERT for Visual Studio
Changing colons to parens permits the error to be recognized, so that clicking on it goes to the source line with the assert. R=reed@google.com Change-Id: Ifec7fc0633e8ecf0f670418fefaf8ca87ee3d498 Reviewed-on: https://skia-review.googlesource.com/16485 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Cary Clark <caryclark@skia.org>
-rw-r--r--include/core/SkPostConfig.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index 0bf33d478a..9628775f35 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -131,11 +131,20 @@
# define SK_DUMP_GOOGLE3_STACK()
#endif
+#ifdef SK_BUILD_FOR_WIN
+// permits visual studio to follow error back to source
+#define SK_DUMP_LINE_FORMAT(message) \
+ SkDebugf("%s(%d): fatal error: \"%s\"\n", __FILE__, __LINE__, message)
+#else
+#define SK_DUMP_LINE_FORMAT(message) \
+ SkDebugf("%s:%d: fatal error: \"%s\"\n", __FILE__, __LINE__, message)
+#endif
+
#ifndef SK_ABORT
# define SK_ABORT(message) \
do { \
SkNO_RETURN_HINT(); \
- SkDebugf("%s:%d: fatal error: \"%s\"\n", __FILE__, __LINE__, message); \
+ SK_DUMP_LINE_FORMAT(message); \
SK_DUMP_GOOGLE3_STACK(); \
sk_abort_no_print(); \
} while (false)