aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkRefCnt.h6
-rw-r--r--include/core/SkTypes.h6
2 files changed, 8 insertions, 4 deletions
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h
index 0e8d857722..1033bccc88 100644
--- a/include/core/SkRefCnt.h
+++ b/include/core/SkRefCnt.h
@@ -9,8 +9,8 @@
#define SkRefCnt_DEFINED
#include "../private/SkAtomics.h"
-#include "../private/SkUniquePtr.h"
#include "SkTypes.h"
+#include <memory>
/** \class SkRefCntBase
@@ -185,9 +185,9 @@ template <typename T> struct SkTUnref {
/**
* Utility class that simply unref's its argument in the destructor.
*/
-template <typename T> class SkAutoTUnref : public skstd::unique_ptr<T, SkTUnref<T>> {
+template <typename T> class SkAutoTUnref : public std::unique_ptr<T, SkTUnref<T>> {
public:
- explicit SkAutoTUnref(T* obj = nullptr) : skstd::unique_ptr<T, SkTUnref<T>>(obj) {}
+ explicit SkAutoTUnref(T* obj = nullptr) : std::unique_ptr<T, SkTUnref<T>>(obj) {}
T* detach() { return this->release(); }
operator T*() const { return this->get(); }
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index d9254acf5f..a722ef8d36 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