Add missing "typename". Rename type in macro.
Missing typename is a bug, apparently missed by treehugger.
type T conflicts with an identically named template parameter in
SkRefSet.h.
Fixes a build break caused by ag/1461060 .
Change-Id: Ie695e760574dc3c84871cd23d57eb7852405ebc5
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h
index 422770c..0be2562 100644
--- a/include/core/SkRefCnt.h
+++ b/include/core/SkRefCnt.h
@@ -144,12 +144,14 @@
#define SkRefCnt_SafeAssign(dst, src) \
do { \
- typedef std::remove_reference<decltype(dst)>::type T; \
- T old_dst = *const_cast<T volatile *>(&dst); \
+ typedef typename std::remove_reference<decltype(dst)>::type \
+ SkRefCntPtrT; \
+ SkRefCntPtrT old_dst = *const_cast<SkRefCntPtrT volatile *>(&dst); \
if (src) src->ref(); \
if (old_dst) old_dst->unref(); \
- if (old_dst != *const_cast<T volatile *>(&dst)) { \
- SkDebugf("Detected racing Skia calls at %s:%d\n", __FILE__, __LINE__); \
+ if (old_dst != *const_cast<SkRefCntPtrT volatile *>(&dst)) { \
+ SkDebugf("Detected racing Skia calls at %s:%d\n", \
+ __FILE__, __LINE__); \
} \
dst = src; \
} while (0)