Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Unified Diff: include/core/SkTypes.h

Issue 1962723003: Make SkAssertResult work with SK_WARN_UNUSED_RESULT in Release on gcc (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTypes.h
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index b44df0de485056969550fc0428374f7d25ee6315..6793e4c0fbba82d02855fa0bcdfebcead3b836d0 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -149,8 +149,8 @@ inline void operator delete(void* p) {
#define SkPARAM(var)
// unlike SkASSERT, this guy executes its condition in the non-debug build.
- // It casts to void to allow use with functions declared with SK_WARN_RESULT_UNUSED.
- #define SkAssertResult(cond) (void)(cond)
+ // The if is present so that this can be used with functions marked SK_WARN_UNUSED_RESULT.
+ #define SkAssertResult(cond) if (cond) {} do {} while(false)
#endif
// Legacy macro names for SK_ABORT
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698