Skip to content

Commit

Permalink
Merge pull request #12 from kajinka13/master
Browse files Browse the repository at this point in the history
Added supports for ARC
  • Loading branch information
ylechelle committed Mar 28, 2012
2 parents a29fc75 + e6b6548 commit 98b77d2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions OpenUDID.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,26 @@
#define kOpenUDIDErrorOptedOut 1
#define kOpenUDIDErrorCompromised 2

//
// Support for ARC
//

#if __has_feature(objc_arc)

#define HAS_ARC 1
#define RETAIN(_o) (_o)
#define RELEASE(_o)
#define AUTORELEASE(_o) (_o)

#else

#define HAS_ARC 0
#define RETAIN(_o) [(_o) retain]
#define RELEASE(_o) [(_o) release]
#define AUTORELEASE(_o) [(_o) autorelease]

#endif

@interface OpenUDID : NSObject {
}
+ (NSString*) value;
Expand Down
4 changes: 2 additions & 2 deletions OpenUDID.m
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ + (NSString*) valueWithError:(NSError **)error {
code:kOpenUDIDErrorOptedOut
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Application %@ is opted-out from OpenUDID as of %@",bundleid,optedOutDate],@"description", nil]];

kOpenUDIDSessionCache = [[NSString stringWithFormat:@"%040x",0] retain];
kOpenUDIDSessionCache = RETAIN(([NSString stringWithFormat:@"%040x",0]));
return kOpenUDIDSessionCache;
}

Expand All @@ -313,7 +313,7 @@ + (NSString*) valueWithError:(NSError **)error {
code:kOpenUDIDErrorNone
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"OpenUDID succesfully retrieved",@"description", nil]];
}
kOpenUDIDSessionCache = [openUDID retain];
kOpenUDIDSessionCache = RETAIN(openUDID);
return kOpenUDIDSessionCache;
}

Expand Down

0 comments on commit 98b77d2

Please sign in to comment.