aboutsummaryrefslogtreecommitdiff
path: root/Foundation
diff options
context:
space:
mode:
Diffstat (limited to 'Foundation')
-rw-r--r--Foundation/GTMNSFileManager+Carbon.m25
-rw-r--r--Foundation/GTMServiceManagement.c4
-rw-r--r--Foundation/GTMSystemVersion.m9
3 files changed, 21 insertions, 17 deletions
diff --git a/Foundation/GTMNSFileManager+Carbon.m b/Foundation/GTMNSFileManager+Carbon.m
index d829cd9..8bd5f69 100644
--- a/Foundation/GTMNSFileManager+Carbon.m
+++ b/Foundation/GTMNSFileManager+Carbon.m
@@ -28,10 +28,10 @@
FSRef ref;
AliasHandle alias = NULL;
- require_quiet([path length], CantUseParams);
- require_noerr(FSPathMakeRef((UInt8 *)[path fileSystemRepresentation],
- &ref, NULL), CantMakeRef);
- require_noerr(FSNewAlias(NULL, &ref, &alias), CantMakeAlias);
+ __Require_Quiet([path length], CantUseParams);
+ __Require_noErr(FSPathMakeRef((UInt8 *)[path fileSystemRepresentation],
+ &ref, NULL), CantMakeRef);
+ __Require_noErr(FSNewAlias(NULL, &ref, &alias), CantMakeAlias);
Size length = GetAliasSize(alias);
data = [NSData dataWithBytes:*alias length:length];
@@ -52,12 +52,12 @@ CantUseParams:
resolve:(BOOL)resolve
withUI:(BOOL)withUI {
NSString *path = nil;
- require_quiet(data, CantUseParams);
+ __Require_Quiet(data, CantUseParams);
AliasHandle alias;
const void *bytes = [data bytes];
NSUInteger length = [data length];
- require_noerr(PtrToHand(bytes, (Handle *)&alias, length), CantMakeHandle);
+ __Require_noErr(PtrToHand(bytes, (Handle *)&alias, length), CantMakeHandle);
FSRef ref;
Boolean wasChanged;
@@ -85,14 +85,14 @@ CantUseParams:
- (FSRef *)gtm_FSRefForPath:(NSString *)path {
FSRef* fsRef = NULL;
- require_quiet([path length], CantUseParams);
+ __Require_Quiet([path length], CantUseParams);
NSMutableData *fsRefData = [NSMutableData dataWithLength:sizeof(FSRef)];
- require(fsRefData, CantAllocateFSRef);
+ __Require(fsRefData, CantAllocateFSRef);
fsRef = (FSRef*)[fsRefData mutableBytes];
Boolean isDir = FALSE;
const UInt8 *filePath = (const UInt8 *)[path fileSystemRepresentation];
- require_noerr_action(FSPathMakeRef(filePath, fsRef, &isDir),
- CantMakeRef, fsRef = NULL);
+ __Require_noErr_action(FSPathMakeRef(filePath, fsRef, &isDir),
+ CantMakeRef, fsRef = NULL);
CantMakeRef:
CantAllocateFSRef:
CantUseParams:
@@ -101,10 +101,11 @@ CantUseParams:
- (NSString *)gtm_pathFromFSRef:(FSRef *)fsRef {
NSString *nsPath = nil;
- require_quiet(fsRef, CantUseParams);
+ __Require_Quiet(fsRef, CantUseParams);
char path[MAXPATHLEN];
- require_noerr(FSRefMakePath(fsRef, (UInt8 *)path, MAXPATHLEN), CantMakePath);
+ __Require_noErr(FSRefMakePath(fsRef, (UInt8 *)path, MAXPATHLEN),
+ CantMakePath);
nsPath = [self stringWithFileSystemRepresentation:path length:strlen(path)];
nsPath = [nsPath stringByStandardizingPath];
diff --git a/Foundation/GTMServiceManagement.c b/Foundation/GTMServiceManagement.c
index dfd0dc6..a57bc2a 100644
--- a/Foundation/GTMServiceManagement.c
+++ b/Foundation/GTMServiceManagement.c
@@ -88,9 +88,9 @@ static bool IsOsYosemiteOrGreater() {
#else
SInt32 version_major;
SInt32 version_minor;
- require_noerr(Gestalt(gestaltSystemVersionMajor, &version_major),
+ __Require_noErr(Gestalt(gestaltSystemVersionMajor, &version_major),
failedGestalt);
- require_noerr(Gestalt(gestaltSystemVersionMinor, &version_minor),
+ __Require_noErr(Gestalt(gestaltSystemVersionMinor, &version_minor),
failedGestalt);
return version_major > 10 || (version_major == 10 && version_minor >= 10);
failedGestalt:
diff --git a/Foundation/GTMSystemVersion.m b/Foundation/GTMSystemVersion.m
index 5738d78..446766b 100644
--- a/Foundation/GTMSystemVersion.m
+++ b/Foundation/GTMSystemVersion.m
@@ -50,9 +50,12 @@ static NSString *const kSystemVersionPlistPath = @"/System/Library/CoreServices/
// <http://lists.apple.com/archives/carbon-dev/2007/Aug/msg00089.html>).
// The iPhone doesn't have Gestalt though, so use the plist there.
#if GTM_MACOS_SDK
- require_noerr(Gestalt(gestaltSystemVersionMajor, &sGTMSystemVersionMajor), failedGestalt);
- require_noerr(Gestalt(gestaltSystemVersionMinor, &sGTMSystemVersionMinor), failedGestalt);
- require_noerr(Gestalt(gestaltSystemVersionBugFix, &sGTMSystemVersionBugFix), failedGestalt);
+ __Require_noErr(Gestalt(gestaltSystemVersionMajor,
+ &sGTMSystemVersionMajor), failedGestalt);
+ __Require_noErr(Gestalt(gestaltSystemVersionMinor,
+ &sGTMSystemVersionMinor), failedGestalt);
+ __Require_noErr(Gestalt(gestaltSystemVersionBugFix,
+ &sGTMSystemVersionBugFix), failedGestalt);
return;