aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkTypes.h
diff options
context:
space:
mode:
authorGravatar djsollen <djsollen@google.com>2016-01-22 06:50:25 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-22 06:50:25 -0800
commitaa97a84404c7505738713a4c19b42347c7daef9e (patch)
treec78f46c5226d73ffeb29e828d60eed196fa7f21d /include/core/SkTypes.h
parent7df3f5e127f8016d17b637cc48a6a4718f1a6822 (diff)
Revert of Consolidate SK_CRASH and sk_throw into SK_ABORT (patchset #5 id:80001 of https://codereview.chromium.org/1610823002/ )
Reason for revert: Chrome is calling SK_CRASH Original issue's description: > Consolidate SK_CRASH and sk_throw into SK_ABORT > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1610823002 > > Committed: https://skia.googlesource.com/skia/+/4c5cd7d527ed29aabfa72aa47b23a4496eeda357 TBR=reed@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1620333002
Diffstat (limited to 'include/core/SkTypes.h')
-rw-r--r--include/core/SkTypes.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 0d31efc6cc..c112b0364f 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -67,7 +67,7 @@ SK_API extern void sk_out_of_memory(void);
The platform implementation must not return, but should either throw
an exception or otherwise exit.
*/
-SK_API extern void sk_abort_no_print(void);
+SK_API extern void sk_throw(void);
enum {
SK_MALLOC_TEMP = 0x01, //!< hint to sk_malloc that the requested memory will be freed in the scope of the stack frame
@@ -128,10 +128,8 @@ inline void operator delete(void* p) {
SK_API void SkDebugf(const char format[], ...);
#endif
-#define SkASSERT_RELEASE(cond) if(!(cond)) { SK_ABORT(#cond); }
-
#ifdef SK_DEBUG
- #define SkASSERT(cond) SkASSERT_RELEASE(cond)
+ #define SkASSERT(cond) SK_ALWAYSBREAK(cond)
#define SkDEBUGFAIL(message) SkASSERT(false && message)
#define SkDEBUGFAILF(fmt, ...) SkASSERTF(false, fmt, ##__VA_ARGS__)
#define SkDEBUGCODE(code) code
@@ -152,9 +150,7 @@ inline void operator delete(void* p) {
#define SkAssertResult(cond) cond
#endif
-// Legacy macro names for SK_ABORT
-#define SkFAIL(message) SK_ABORT(message)
-#define sk_throw() SK_ABORT("sk_throw")
+#define SkFAIL(message) SK_ALWAYSBREAK(false && message)
// We want to evaluate cond only once, and inside the SkASSERT somewhere so we see its string form.
// So we use the comma operator to make an SkDebugf that always returns false: we'll evaluate cond,