diff options
author | thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2008-04-14 17:21:02 +0000 |
---|---|---|
committer | thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2008-04-14 17:21:02 +0000 |
commit | cdf070c8d76ffc4eaa24e8671756cbbe9ceb2890 (patch) | |
tree | faa9ae3a72a6591d6a6add7ceed7f91e92ade11f /Foundation/GTMObjC2Runtime.h | |
parent | 0aaecac6ff2bc89e58a0c8c6d6ad62e02fb2b011 (diff) |
See the ReleaseNotes for the full details, highlights:
- bug fixes
- code coverage support
- more complete unittests
- full support for unittesting UIs
- support for the iphone sdk (include ui unittesting)
Diffstat (limited to 'Foundation/GTMObjC2Runtime.h')
-rw-r--r-- | Foundation/GTMObjC2Runtime.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Foundation/GTMObjC2Runtime.h b/Foundation/GTMObjC2Runtime.h new file mode 100644 index 0000000..325a752 --- /dev/null +++ b/Foundation/GTMObjC2Runtime.h @@ -0,0 +1,54 @@ +// +// GTMObjC2Runtime.h +// +// Copyright 2007-2008 Google Inc. +// +// 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 +// License for the specific language governing permissions and limitations under +// the License. +// + +#import <objc/objc-runtime.h> +#import <objc/Object.h> + +// These functions exist for code that we want to compile on both the < 10.5 +// sdks and on the >= 10.5 sdks without warnings. It basically reimplements +// certain parts of the objc2 runtime in terms of the objc1 runtime. It is not +// a complete implementation as I've only implemented the routines I know we +// use. Feel free to add more as necessary. +// These functions are not documented because they conform to the documentation +// for the ObjC2 Runtime. + +#if OBJC_API_VERSION >= 2 // Only have optional and req'd keywords in ObjC2. +#define AT_OPTIONAL @optional +#define AT_REQUIRED @required +#else +#define AT_OPTIONAL +#define AT_REQUIRED +#endif + +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 +#import "objc/Protocol.h" + +Class object_getClass(id obj); +const char *class_getName(Class cls); +BOOL class_conformsToProtocol(Class cls, Protocol *protocol); +Class class_getSuperclass(Class cls); +Method *class_copyMethodList(Class cls, unsigned int *outCount); +SEL method_getName(Method m); +void method_exchangeImplementations(Method m1, Method m2); +IMP method_getImplementation(Method method); +IMP method_setImplementation(Method method, IMP imp); +struct objc_method_description protocol_getMethodDescription(Protocol *p, + SEL aSel, + BOOL isRequiredMethod, + BOOL isInstanceMethod); +#endif // OBJC2_UNAVAILABLE |