Permalink
Browse files

Remove dct_weak.h

  • Loading branch information...
1 parent 5031180 commit f936b6b04dbb0da4f821414c685cea2e605914b1 @danielctull committed Jun 14, 2012
@@ -14,7 +14,6 @@
24F6EC54158A2BD200CEDD41 /* libDCTConnectionController.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 24F6EC3C158A2BD100CEDD41 /* libDCTConnectionController.a */; };
24F6EC5A158A2BD200CEDD41 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 24F6EC58158A2BD200CEDD41 /* InfoPlist.strings */; };
24F6EC5D158A2BD200CEDD41 /* DCTConnectionControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EC5C158A2BD200CEDD41 /* DCTConnectionControllerTests.m */; };
- 24F6EC79158A2C3000CEDD41 /* dct_weak.h in Headers */ = {isa = PBXBuildFile; fileRef = 24F6EC66158A2C3000CEDD41 /* dct_weak.h */; };
24F6EC7A158A2C3000CEDD41 /* DCTConnectionController.h in Headers */ = {isa = PBXBuildFile; fileRef = 24F6EC67158A2C3000CEDD41 /* DCTConnectionController.h */; settings = {ATTRIBUTES = (Public, ); }; };
24F6EC7B158A2C3000CEDD41 /* DCTConnectionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EC68158A2C3000CEDD41 /* DCTConnectionController.m */; };
24F6EC7C158A2C3000CEDD41 /* DCTConnectionController+BlockHandlers.h in Headers */ = {isa = PBXBuildFile; fileRef = 24F6EC69158A2C3000CEDD41 /* DCTConnectionController+BlockHandlers.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -55,7 +54,6 @@
24F6EC59158A2BD200CEDD41 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
24F6EC5B158A2BD200CEDD41 /* DCTConnectionControllerTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DCTConnectionControllerTests.h; sourceTree = "<group>"; };
24F6EC5C158A2BD200CEDD41 /* DCTConnectionControllerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DCTConnectionControllerTests.m; sourceTree = "<group>"; };
- 24F6EC66158A2C3000CEDD41 /* dct_weak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dct_weak.h; sourceTree = "<group>"; };
24F6EC67158A2C3000CEDD41 /* DCTConnectionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCTConnectionController.h; sourceTree = "<group>"; };
24F6EC68158A2C3000CEDD41 /* DCTConnectionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCTConnectionController.m; sourceTree = "<group>"; };
24F6EC69158A2C3000CEDD41 /* DCTConnectionController+BlockHandlers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DCTConnectionController+BlockHandlers.h"; sourceTree = "<group>"; };
@@ -131,7 +129,6 @@
24F6EC41158A2BD100CEDD41 /* DCTConnectionController */ = {
isa = PBXGroup;
children = (
- 24F6EC66158A2C3000CEDD41 /* dct_weak.h */,
24F6EC67158A2C3000CEDD41 /* DCTConnectionController.h */,
24F6EC68158A2C3000CEDD41 /* DCTConnectionController.m */,
24F6EC69158A2C3000CEDD41 /* DCTConnectionController+BlockHandlers.h */,
@@ -180,7 +177,6 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
- 24F6EC79158A2C3000CEDD41 /* dct_weak.h in Headers */,
24F6EC7A158A2C3000CEDD41 /* DCTConnectionController.h in Headers */,
24F6EC7C158A2C3000CEDD41 /* DCTConnectionController+BlockHandlers.h in Headers */,
24F6EC7E158A2C3000CEDD41 /* DCTConnectionController+Equality.h in Headers */,
@@ -454,6 +450,7 @@
24F6EC62158A2BD200CEDD41 /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
24F6EC63158A2BD200CEDD41 /* Build configuration list for PBXNativeTarget "DCTConnectionControllerTests" */ = {
isa = XCConfigurationList;
@@ -462,6 +459,7 @@
24F6EC65158A2BD200CEDD41 /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
@@ -34,8 +34,6 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "dct_weak.h"
-
#import <Foundation/Foundation.h>
#ifndef dctconnectioncontroller
@@ -142,7 +142,7 @@ - (id)init {
_priority = DCTConnectionControllerPriorityMedium;
_statusChangeBlocks = [NSMutableSet new];
- __dct_weak DCTConnectionController *weakSelf = self;
+ __unsafe_unretained DCTConnectionController *weakSelf = self;
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[self addStatusChangeHandler:^(DCTConnectionControllerStatus status) {
@@ -205,7 +205,7 @@ - (void)connectOnQueue:(DCTConnectionQueue *)connectionQueue {
self.status = existingConnectionController.status;
- __dct_weak DCTConnectionController *weakExistingConnectionController = existingConnectionController;
+ __unsafe_unretained DCTConnectionController *weakExistingConnectionController = existingConnectionController;
[existingConnectionController addStatusChangeHandler:^(DCTConnectionControllerStatus status) {
__strong DCTConnectionController *strongExistingConnectionController = weakExistingConnectionController;
@@ -74,7 +74,7 @@ - (void)addConnectionController:(DCTConnectionController *)connectionController
[self.dctInternal_connectionControllers addObject:connectionController];
- __dct_weak DCTConnectionGroup *weakself = self;
+ __unsafe_unretained DCTConnectionGroup *weakself = self;
[connectionController addStatusChangeHandler:^(DCTConnectionControllerStatus status) {
[weakself dctInternal_checkControllers];
@@ -188,7 +188,7 @@ - (void)dctConnectionGroupInternal_addConnectionGroup:(DCTConnectionGroup *)conn
[groups addObject:connectionGroup];
- __dct_weak DCTConnectionGroup *group = connectionGroup;
+ __unsafe_unretained DCTConnectionGroup *group = connectionGroup;
[connectionGroup addCompletionHandler:^(NSArray *finishedConnectionControllers, NSArray *failedConnectionControllers, NSArray *cancelledConnectionControllers) {
[groups removeObject:group];
@@ -104,8 +104,8 @@ - (void)addConnectionController:(DCTConnectionController *)connectionController
dispatch_async(_dispatchQueue, ^{
- __dct_weak DCTConnectionController *weakConnectionController = connectionController;
- __dct_weak DCTConnectionQueue *weakSelf = self;
+ __unsafe_unretained DCTConnectionController *weakConnectionController = connectionController;
+ __unsafe_unretained DCTConnectionQueue *weakSelf = self;
[connectionController addStatusChangeHandler:^(DCTConnectionControllerStatus status) {
if (status <= DCTConnectionControllerStatusResponded) return;
@@ -1,60 +0,0 @@
-#ifndef _DCT_WEAK_H
-#define _DCT_WEAK_H
-
-// Macros for portable support of notionally weak properties with ARC
-// Contributors: Daniel Tull, Abizer Nasir, Rowan James
-// Current version: https://gist.github.com/1652385
-// Defines:
-// dct_weak to be used as a replacement for the 'weak' keyword:
-// @property (dct_weak) NSObject* propertyName;
-// __dct_weak to be used as a replacement for the '__weak' variable attribute:
-// __dct_weak NSObject* variableName;
-// dct_nil(x) assigns nil to x only if ARC is not supported
-
-#import <Availability.h>
-
-#define dct_arc_MIN_IOS_SDK 40000
-#define dct_arc_MIN_IOS_TARGET 40000
-#define dct_arc_MIN_IOS_WEAK_TARGET 50000
-
-#define dct_arc_MIN_OS_X_SDK 1070
-#define dct_arc_MIN_OS_X_TARGET 1060
-#define dct_arc_MIN_OS_X_WEAK_TARGET 1070
-
-// iOS conditions
-#if defined __IPHONE_OS_VERSION_MAX_ALLOWED
-# if __IPHONE_OS_VERSION_MAX_ALLOWED < dct_arc_MIN_IOS_SDK
-# warning "This program uses ARC which is only available in iOS SDK 4.3 and later."
-# endif
-# if __IPHONE_OS_VERSION_MIN_REQUIRED >= dct_arc_MIN_IOS_WEAK_TARGET
-# define dct_weak weak
-# define __dct_weak __weak
-# define dct_nil(x)
-# elif __IPHONE_OS_VERSION_MIN_REQUIRED >= dct_arc_MIN_IOS_TARGET
-# define dct_weak unsafe_unretained
-# define __dct_weak __unsafe_unretained
-# define dct_nil(x) x = nil
-# endif
-
-// OS X equivalent
-#elif defined __MAC_OS_X_VERSION_MIN_REQUIRED
-// check for the OS X 10.7 SDK (can still target 10.6 with ARC using it)
-# if __MAC_OS_X_VERSION_MAX_ALLOWED < dct_arc_MIN_OS_X_SDK
-# warning "This program uses ARC which is only available in OS X SDK 10.7 and later."
-# endif
-# if __MAC_OS_X_VERSION_MIN_REQUIRED >= dct_arc_MIN_OS_X_WEAK_TARGET
-# define dct_weak weak
-# define __dct_weak __weak
-# define dct_nil(x)
-# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= dct_arc_MIN_OS_X_TARGET
-# define dct_weak unsafe_unretained
-# define __dct_weak __unsafe_unretained
-# define dct_nil(x) x = nil
-# endif
-#else
-
-// Couldn't determine the platform, but ARC is still needed, so...
-# warning "This program requires ARC but we couldn't determine if your environment supports it"
-#endif
-
-#endif // include guard

0 comments on commit f936b6b

Please sign in to comment.