X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6ecc2922dae7edcb6b89b14e33454511ed8441c6..09b895cb4a954494063eb17d3dc302a654fd99e5:/include/wx/cocoa/ObjcRef.h?ds=sidebyside diff --git a/include/wx/cocoa/ObjcRef.h b/include/wx/cocoa/ObjcRef.h index 44acfa8c45..ccb3d3156f 100644 --- a/include/wx/cocoa/ObjcRef.h +++ b/include/wx/cocoa/ObjcRef.h @@ -15,7 +15,7 @@ // Reuse wxCFRef-related code (e.g. wxCFRetain/wxCFRelease) #include "wx/mac/corefoundation/cfref.h" -// NOTE WELL: We can only know which Objective-C runtime is being used when compiling Objective-C. +// NOTE WELL: We can only know whether or not GC can be used when compiling Objective-C. // Therefore we cannot implement these functions except when compiling Objective-C. #ifdef __OBJC__ /*! @function wxGCSafeRetain @@ -58,7 +58,7 @@ template inline Type * wxGCSafeRetain(Type *r) { -#ifdef __NEXT_RUNTIME__ +#ifdef __OBJC_GC__ return static_cast(wxCFRetain(r)); #else return [r retain]; @@ -90,7 +90,7 @@ inline Type * wxGCSafeRetain(Type *r) template inline void wxGCSafeRelease(Type *r) { -#ifdef __NEXT_RUNTIME__ +#ifdef __OBJC_GC__ wxCFRelease(r); #else [r release]; @@ -99,7 +99,10 @@ inline void wxGCSafeRelease(Type *r) #else // NOTE: When not compiling Objective-C, declare these functions such that they can be // used by other inline-implemented methods. Since those methods in turn will not actually -// be used from non-ObjC code there is no problem. +// be used from non-ObjC code the compiler ought not emit them. If it emits an out of +// line copy of those methods then presumably it will have also emitted at least one +// out of line copy of these functions from at least one Objective-C++ translation unit. +// That means the out of line implementation will be available at link time. template inline Type * wxGCSafeRetain(Type *r);