Skip to content

Commit

Permalink
Add missing "typename". Rename type in macro.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hboehm committed Sep 27, 2016
1 parent 0e90812 commit e9f90a2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions include/core/SkRefCnt.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,14 @@ class SK_API SkRefCnt : public SkRefCntBase { };

#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)
Expand Down

0 comments on commit e9f90a2

Please sign in to comment.