Changeset 268543 in webkit
- Timestamp:
- Oct 15, 2020 12:12:02 PM (4 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r268503 r268543 1 2020-10-15 David Kilzer <ddkilzer@apple.com> 2 3 WeakObjCPtr.h is not safe to include in C++ source files 4 <https://webkit.org/b/217712> 5 <rdar://problem/70250667> 6 7 Reviewed by Darin Adler. 8 9 * wtf/WeakObjCPtr.h: 10 (WTF::WeakObjCPtr::get const): 11 - Move implementation outside of the class and wrap it in 12 #ifdef __OBJC__/#endif. This makes the header safe to compile 13 with other C++ sources, but will fail if get() is used in a 14 C++ source file. 15 1 16 2020-10-14 Ryosuke Niwa <rniwa@webkit.org> 2 17 -
trunk/Source/WTF/wtf/WeakObjCPtr.h
r234685 r268543 1 1 /* 2 * Copyright (C) 2013-20 18Apple Inc. All rights reserved.2 * Copyright (C) 2013-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 82 82 } 83 83 84 RetainPtr<ValueType> get() const 85 { 86 #if __has_feature(objc_arc) 87 return static_cast<ValueType *>(m_weakReference); 88 #else 89 return adoptNS(objc_loadWeakRetained(&m_weakReference)); 90 #endif 91 } 84 RetainPtr<ValueType> get() const; 92 85 93 86 ValueType *getAutoreleased() const … … 111 104 }; 112 105 106 #ifdef __OBJC__ 107 template<typename T> 108 RetainPtr<typename WeakObjCPtr<T>::ValueType> WeakObjCPtr<T>::get() const 109 { 110 #if __has_feature(objc_arc) 111 return static_cast<typename WeakObjCPtr<T>::ValueType *>(m_weakReference); 112 #else 113 return adoptNS(objc_loadWeakRetained(&m_weakReference)); 114 #endif 115 } 116 #endif 117 113 118 } // namespace WTF 114 119
Note: See TracChangeset
for help on using the changeset viewer.