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

Unified Diff: include/core/SkTypes.h

Issue 1436033003: skstd -> std for unique_ptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Android fix? Created 5 years 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
Index: include/core/SkTypes.h
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 5720c30970e5d2ce1ad9f69922caa6a32eeb1163..b3bcc19c170af462845e0342c685a841d6a930c5 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -257,7 +257,11 @@ typedef uint8_t SkBool8;
/** Returns 0 or 1 based on the condition
*/
-#define SkToBool(cond) ((cond) != 0)
+#if defined(_MSC_VER)
+ #define SkToBool(cond) (!!(cond)) // MSVC doesn't like a cast.
+#else
+ #define SkToBool(cond) static_cast<bool>(cond)
+#endif
#define SK_MaxS16 32767
#define SK_MinS16 -32767

Powered by Google App Engine
This is Rietveld 408576698