X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/fa7225c82381bac4432a6edf16f53b5370238d85..7e6b461318c8a779d91381531435a68ee4e8b6ed:/OSX/libsecurity_utilities/lib/seccfobject.h diff --git a/OSX/libsecurity_utilities/lib/seccfobject.h b/OSX/libsecurity_utilities/lib/seccfobject.h index 26c39288..29e9a5d3 100644 --- a/OSX/libsecurity_utilities/lib/seccfobject.h +++ b/OSX/libsecurity_utilities/lib/seccfobject.h @@ -29,7 +29,11 @@ #include #include #include "threading.h" +#include + +#if( __cplusplus <= 201103L) #include +#endif namespace Security { @@ -42,7 +46,9 @@ operator APIPTR() const \ \ OBJTYPE *retain() \ { SecCFObject::handle(true); return this; } \ -APIPTR handle(bool retain = true) \ +APIPTR CF_RETURNS_RETAINED handle() \ +{ return (APIPTR)SecCFObject::handle(true); } \ +APIPTR handle(bool retain) \ { return (APIPTR)SecCFObject::handle(retain); } #define SECCFFUNCTIONS_CREATABLE(OBJTYPE, APIPTR, CFCLASS) \ @@ -79,7 +85,7 @@ private: static const size_t kAlignedRuntimeSize = SECALIGNUP(sizeof(SecRuntimeBase), 4); uint32_t mRetainCount; - OSSpinLock mRetainSpinLock; + os_unfair_lock mRetainLock; public: // For use by SecPointer only. Returns true once the first time it's called after the object has been created.