aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMObjC2Runtime.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2012-04-04 00:02:43 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2012-04-04 00:02:43 +0000
commit66a61fbc1c930c8e5c2655ba03d31197e04fe400 (patch)
treebb1e5938f71bfcf8e8f0092bd4924ef61aa8b5ce /Foundation/GTMObjC2Runtime.m
parent22eb588ba8eb86b3f3bf1367daf86cb55bd9a41a (diff)
[Author: aharper]
Implement sel_isEqual R=dmaclach APPROVED=dmaclach
Diffstat (limited to 'Foundation/GTMObjC2Runtime.m')
-rw-r--r--Foundation/GTMObjC2Runtime.m15
1 files changed, 10 insertions, 5 deletions
diff --git a/Foundation/GTMObjC2Runtime.m b/Foundation/GTMObjC2Runtime.m
index 2eb5dc3..0b4614c 100644
--- a/Foundation/GTMObjC2Runtime.m
+++ b/Foundation/GTMObjC2Runtime.m
@@ -6,9 +6,9 @@
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
// of the License at
-//
+//
// http://www.apache.org/licenses/LICENSE-2.0
-//
+//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -73,7 +73,7 @@ Method *class_copyMethodList(Class cls, unsigned int *outCount) {
while ( (mlist = class_nextMethodList(cls, &iterator)) ) {
if (mlist->method_count == 0) continue;
- methods = (Method *)realloc(methods,
+ methods = (Method *)realloc(methods,
sizeof(Method) * (count + mlist->method_count + 1));
if (!methods) {
//Memory alloc failed, so what can we do?
@@ -107,7 +107,7 @@ IMP method_setImplementation(Method method, IMP imp) {
// We intentionally don't test method for nil.
// Leopard fails here, so should we.
// I logged this as Radar:
- // 5572981 method_setImplementation crashes if you pass nil for the
+ // 5572981 method_setImplementation crashes if you pass nil for the
// method arg (arg 1)
// because it seems odd that this API won't accept nil for method considering
// all the other apis will accept nil args.
@@ -121,7 +121,7 @@ IMP method_setImplementation(Method method, IMP imp) {
if (imp) {
oldImp = method->method_imp;
method->method_imp = imp;
- }
+ }
return oldImp;
}
@@ -154,6 +154,11 @@ struct objc_method_description protocol_getMethodDescription(Protocol *p,
return desc;
}
+BOOL sel_isEqual(SEL lhs, SEL rhs) {
+ // Apple (informally) promises this will work in the future:
+ // http://twitter.com/#!/gparker/status/2400099786
+ return (lhs == rhs) ? YES : NO;
+}
#endif