mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2024-11-30 15:30:31 +00:00
+load for Darwin improved
This commit is contained in:
parent
f826ee093d
commit
c8763a11d0
@ -123,7 +123,9 @@ BOOL NSObjectIsKindOfClass(id object,Class kindOf) {
|
||||
|
||||
+ (void)poseAsClass:(Class)aClass
|
||||
{
|
||||
NSAutoreleasePool * pool = [NSAutoreleasePool new];
|
||||
NSUnimplementedMethod();
|
||||
[pool release];
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,4 +33,5 @@ typedef struct {
|
||||
OBJCArray *moduleArray;
|
||||
} OBJCObjectFile;
|
||||
|
||||
OBJC_EXPORT void OBJCQueueModule(OBJCModule *module);
|
||||
OBJC_EXPORT void OBJCQueueModule(OBJCModule *module);
|
||||
OBJC_EXPORT void OBJCSendLoadMessages();
|
@ -410,6 +410,16 @@ static void OBJCSymbolTableRegisterClasses(OBJCSymbolTable *symbolTable){
|
||||
OBJCRegisterClass(class);
|
||||
OBJCAddToUnResolvedClasses(class);
|
||||
|
||||
#ifdef APPLE
|
||||
if(strcmp(class_getName(class), "NSConstantString") == 0) {
|
||||
memcpy(&_NSConstantStringClassReference, cls, sizeof(_NSConstantStringClassReference));
|
||||
}
|
||||
|
||||
if(strcmp(class_getName(class), "NSDarwinString") == 0) {
|
||||
memcpy(&__CFConstantStringClassReference, cls, sizeof(_NSConstantStringClassReference));
|
||||
}
|
||||
#endif
|
||||
|
||||
if(strcmp(class_getName(class), "Protocol") == 0) {
|
||||
// Fix protocol classes where isa is not yet set. This is the case for all
|
||||
// classes loaded before Protocol class is loaded.
|
||||
@ -542,7 +552,10 @@ void OBJCQueueModule(OBJCModule *module) {
|
||||
#endif
|
||||
|
||||
OBJCLinkClassTable();
|
||||
#ifndef __APPLE__
|
||||
|
||||
OBJCSendLoadMessages();
|
||||
#endif
|
||||
}
|
||||
|
||||
void OBJCResetModuleQueue(void) {
|
||||
|
@ -161,5 +161,8 @@ void OBJCRegisterModule_Darwin(const char * name)
|
||||
|
||||
// Override the compiler version of the class
|
||||
//objc_addClass(&_NSConstantStringClassReference);
|
||||
|
||||
OBJCSendLoadMessages();
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user