aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkTypes.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-12-02 10:46:18 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-02 10:46:18 -0800
commitdadfc245cc9a0279ff7b73da3344f2ca5d139907 (patch)
tree9c6bf9da62a5e71ca1242e95b6031f52ee0642e8 /include/core/SkTypes.h
parent954cbc15b39e1b45c6244f2811b5ac6be6e412fd (diff)
skstd -> std for unique_ptr
TBR=reed@google.com No public API changes. BUG=skia:4564 Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot,Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release-Trybot Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065 Committed: https://skia.googlesource.com/skia/+/70e8dfca4a7f5bce97b8021a6e378c4828b09c8c Review URL: https://codereview.chromium.org/1436033003
Diffstat (limited to 'include/core/SkTypes.h')
-rw-r--r--include/core/SkTypes.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 5720c30970..b3bcc19c17 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