aboutsummaryrefslogtreecommitdiff
path: root/AppKit
diff options
context:
space:
mode:
authorGravatar Mark Mentovai <mark@chromium.org>2017-07-10 17:24:25 -0400
committerGravatar Thomas Van Lenten <thomasvl@google.com>2017-07-10 17:41:00 -0400
commitec72a2bc500a716369c383837bffdc7d2a22855b (patch)
tree51caaa4dff0df947186a969f697acd3d53f55a41 /AppKit
parentc867eb4055d715b8aa56e1ce630e739df3abdc0a (diff)
10.13 SDK (and iOS 11 equivalent) compatibility for GTM
Starting in the 10.6 SDK, the non-underscored and all-lowercase macro names in <AssertMacros.h> were deprecated. In the 10.13 SDK shipping in Xcode 9 beta 3 (but not previous betas of Xcode 9), Apple has made good on its promise to eventually disable these names. Update GTM to use the new underscored mixed-case names. Provided that nobody needs to target anything older than the 10.5 SDK anymore, this should be a safe change. Aside from GTMCarbonEvent.m, which is used by Chrome, this change is untested, and was made by mechanically replacing uses of the various check, require, and verify macros found in GTM.
Diffstat (limited to 'AppKit')
-rw-r--r--AppKit/GTMCarbonEvent.m57
1 files changed, 29 insertions, 28 deletions
diff --git a/AppKit/GTMCarbonEvent.m b/AppKit/GTMCarbonEvent.m
index e18551e..3f51271 100644
--- a/AppKit/GTMCarbonEvent.m
+++ b/AppKit/GTMCarbonEvent.m
@@ -94,8 +94,8 @@
//
- (id)initWithClass:(UInt32)inClass kind:(UInt32)kind {
if ((self = [super init])) {
- verify_noerr(CreateEvent(kCFAllocatorDefault, inClass, kind,
- 0, kEventAttributeNone, &event_));
+ __Verify_noErr(CreateEvent(kCFAllocatorDefault, inClass, kind,
+ 0, kEventAttributeNone, &event_));
}
return self;
}
@@ -186,7 +186,7 @@
// time - the time you want associated with the event
//
- (void)setTime:(EventTime)eventTime {
- verify_noerr(SetEventTime(event_, eventTime));
+ __Verify_noErr(SetEventTime(event_, eventTime));
}
@@ -243,16 +243,16 @@
// Post event to current queue with standard priority.
//
- (void)postToCurrentQueue {
- verify_noerr([self postToQueue:GetCurrentEventQueue()
- priority:kEventPriorityStandard]);
+ __Verify_noErr([self postToQueue:GetCurrentEventQueue()
+ priority:kEventPriorityStandard]);
}
// Post event to main queue with standard priority.
//
- (void)postToMainQueue {
- verify_noerr([self postToQueue:GetMainEventQueue()
- priority:kEventPriorityStandard]);
+ __Verify_noErr([self postToQueue:GetMainEventQueue()
+ priority:kEventPriorityStandard]);
}
@@ -269,7 +269,7 @@
type:(EventParamType)type
size:(ByteCount)size
data:(const void *)data {
- verify_noerr(SetEventParameter(event_, name, type, size, data));
+ __Verify_noErr(SetEventParameter(event_, name, type, size, data));
}
@@ -308,7 +308,7 @@
- (ByteCount)sizeOfParameterNamed:(EventParamName)name
type:(EventParamType)type {
ByteCount size = 0;
- verify_noerr(GetEventParameter(event_, name, type, NULL, 0, &size, NULL));
+ __Verify_noErr(GetEventParameter(event_, name, type, NULL, 0, &size, NULL));
return size;
}
@@ -345,7 +345,7 @@ const OSType kGTMCarbonFrameworkSignature = 'GTM ';
-(void)dealloc {
if (eventHandler_) {
- verify_noerr(RemoveEventHandler(eventHandler_));
+ __Verify_noErr(RemoveEventHandler(eventHandler_));
}
[super dealloc];
}
@@ -364,7 +364,7 @@ const OSType kGTMCarbonFrameworkSignature = 'GTM ';
// count - the number of EventTypeSpecs in events.
//
- (void)registerForEvents:(const EventTypeSpec *)events count:(size_t)count {
- verify_noerr(AddEventTypesToHandler([self eventHandler], count, events));
+ __Verify_noErr(AddEventTypesToHandler([self eventHandler], count, events));
}
// Causes the event handler to stop listening for |events|.
@@ -374,7 +374,8 @@ const OSType kGTMCarbonFrameworkSignature = 'GTM ';
// count - the number of EventTypeSpecs in events.
//
- (void)unregisterForEvents:(const EventTypeSpec *)events count:(size_t)count {
- verify_noerr(RemoveEventTypesFromHandler([self eventHandler], count, events));
+ __Verify_noErr(
+ RemoveEventTypesFromHandler([self eventHandler], count, events));
}
// To be overridden by subclasses to respond to events. All subclasses should
@@ -390,9 +391,9 @@ const OSType kGTMCarbonFrameworkSignature = 'GTM ';
- (OSStatus)handleEvent:(GTMCarbonEvent *)event
handler:(EventHandlerCallRef)handler {
OSStatus status = eventNotHandledErr;
- require(event, CantUseParams);
- require(handler, CantUseParams);
- require([event event], CantUseParams);
+ __Require(event, CantUseParams);
+ __Require(handler, CantUseParams);
+ __Require([event event], CantUseParams);
status = CallNextEventHandler(handler, [event event]);
CantUseParams:
return status;
@@ -452,9 +453,9 @@ static OSStatus EventHandler(EventHandlerCallRef inHandler,
if ( sHandlerProc == NULL ) {
sHandlerProc = NewEventHandlerUPP(EventHandler);
}
- verify_noerr(InstallEventHandler([self eventTarget],
- sHandlerProc, 0,
- NULL, self, &eventHandler_));
+ __Verify_noErr(InstallEventHandler([self eventTarget],
+ sHandlerProc, 0,
+ NULL, self, &eventHandler_));
}
return eventHandler_;
}
@@ -590,14 +591,14 @@ extern EventTargetRef GetApplicationEventTarget(void);
action:selector
userInfo:userInfo
whenPressed:onKeyDown] autorelease];
- require(newKey, CantCreateKey);
- require_noerr_action(RegisterEventHotKey((UInt32)keyCode,
- GTMCocoaToCarbonKeyModifiers(cocoaModifiers),
- keyID,
- [self eventTarget],
- 0,
- &theRef),
- CantRegisterHotKey, newKey = nil);
+ __Require(newKey, CantCreateKey);
+ __Require_noErr_Action(RegisterEventHotKey((UInt32)keyCode,
+ GTMCocoaToCarbonKeyModifiers(cocoaModifiers),
+ keyID,
+ [self eventTarget],
+ 0,
+ &theRef),
+ CantRegisterHotKey, newKey = nil);
[newKey setHotKeyRef:theRef];
[hotkeys_ addObject:newKey];
@@ -610,10 +611,10 @@ CantCreateKey:
// Arguments:
// keyRef - the EventHotKeyRef to unregister
- (void)unregisterHotKey:(GTMCarbonHotKey *)keyRef {
- check([hotkeys_ containsObject:keyRef]);
+ __Check([hotkeys_ containsObject:keyRef]);
[[keyRef retain] autorelease];
[hotkeys_ removeObject:keyRef];
- verify_noerr(UnregisterEventHotKey([keyRef hotKeyRef]));
+ __Verify_noErr(UnregisterEventHotKey([keyRef hotKeyRef]));
}
// A hotkey has been hit. See if it is one of ours, and if so fire it.