Make SkAssertResult work with SK_WARN_UNUSED_RESULT in Release on gcc

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1962723003

Review-Url: https://codereview.chromium.org/1962723003
This commit is contained in:
bsalomon 2016-05-09 12:35:17 -07:00 committed by Commit bot
parent 167ab91980
commit 1b4c01c660

View File

@ -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