Open d235j opened 5 years ago
I'm happy to take a pull request that updates these for Apple compatibility.
It would very interesting to implement the required APIs. @davidchisnall what are your plans regarding GCC API deprecation?
Most of the GCC APIs are guarded by an off by default flag, we can remove them at some point. The construct and destruct instance are probably not possible to support because it relies on a runtime that doesn’t add an object header.
The GNUstep libobjc2 API does not match Apple documentation. Some of these mismatches cause problems building code that links against the Apple runtime, e.g. Swift. The lack of objc_constructInstance and objc_destructInstance is discussed in https://github.com/gnustep/libobjc2/issues/121. Other than this, the signature differences in
objc_lookUpClass
andobjc_getRequiredClass
are the most problematic (Class
vs.id
).The following methods are defined in a header not included from <objc/runtime.h>, but are part of the Runtime API:
OBJC_PUBLIC id objc_loadWeak(id object); OBJC_PUBLIC id objc_storeWeak(id addr, id obj);
The following methods have new annotations:
objc_property_t _Nonnull class_copyPropertyList(Class cls, unsigned int outCount); Method _Nonnull class_copyMethodList(Class cls, unsigned int outCount); Ivar object_getInstanceVariable(id obj, const char name, void _Nullable outValue); int objc_getClassList(Class _Nonnull buffer, int bufferCount); Class _Nonnull objc_copyClassList(unsigned int outCount); objc_property_t _Nonnull protocol_copyPropertyList(Protocol proto, unsigned int outCount); id objc_loadWeak(id _Nullable location); id objc_storeWeak(id _Nullable *location, id obj);
The following methods are unimplemented and probably should be implemented at some point: struct objc_method_description * method_getDescription(Method m);
The following methods are unimplemented but should not be necessary: Class objc_getFutureClass(const char name); void objc_setFutureClass (Class cls, const char name); Class objc_duplicateClass(Class original, const char name, size_t extraBytes); void objc_enumerationMutation(id obj); void objc_setEnumerationMutationHandler(void (handler)(id));