Removed incorrect comment from blocks runtime. Tweaked runtime.h to make it show the new functions even in GNU-compat mode and made sure the object-substitution hook is called even when object substitution can't be used, so GNUstep can use it for the 10.5 NSObject runtime functions.

main
theraven 17 years ago
parent 252447c95f
commit bba507bf70

@ -31,6 +31,25 @@ libobjc_C_FILES = \
selector.c\ selector.c\
sendmsg.c\ sendmsg.c\
thr.c thr.c
libobjc_HEADER_FILES_DIR = objc
libobjc_HEADER_FILES_INSTALL_DIR = objc
libobjc_HEADER_FILES = \
Availability.h\
NXConstStr.h\
Object.h\
Protocol.h\
blocks_runtime.h\
encoding.h\
hash.h\
objc-api.h\
objc-decls.h\
objc-list.h\
objc.h\
runtime-legacy.h\
runtime.h\
sarray.h\
thr.h\
typedstream.h
# Deprecated functions are only deprecated for external use, not for us because # Deprecated functions are only deprecated for external use, not for us because
# we are special, precious, little flowers. # we are special, precious, little flowers.

@ -198,7 +198,6 @@ struct StackBlockClass {
// Copy a block to the heap if it's still on the stack or increments its retain count. // Copy a block to the heap if it's still on the stack or increments its retain count.
// The block is considered on the stack if self->descriptor->reserved == 0.
void *_Block_copy(void *src) void *_Block_copy(void *src)
{ {
struct StackBlockClass *self = src; struct StackBlockClass *self = src;

@ -4,6 +4,7 @@
// If __LEGACY_GNU_MODE__ is defined then we include the old GNU runtime header // If __LEGACY_GNU_MODE__ is defined then we include the old GNU runtime header
// instead of this one // instead of this one
#ifndef __OBJC_LEGACY_GNU_MODE__ #ifndef __OBJC_LEGACY_GNU_MODE__
#define __GNUSTEP_RUNTIME__
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
@ -255,6 +256,10 @@ objc_property_t protocol_getProperty(Protocol *p, const char *name,
BOOL protocol_isEqual(Protocol *p, Protocol *other); BOOL protocol_isEqual(Protocol *p, Protocol *other);
#else
#include "runtime-legacy.h"
#endif // __LEGACY_GNU_MODE__
/** /**
* The objc_slot structure is used to permit safe IMP caching. It is returned * The objc_slot structure is used to permit safe IMP caching. It is returned
* by the new lookup APIs. When you cache an IMP, you should store a copy of * by the new lookup APIs. When you cache an IMP, you should store a copy of
@ -298,7 +303,8 @@ struct objc_slot
* New ABI lookup function. Receiver may be modified during lookup or proxy * New ABI lookup function. Receiver may be modified during lookup or proxy
* forwarding and the sender may affect how lookup occurs. * forwarding and the sender may affect how lookup occurs.
*/ */
struct objc_slot *objc_msg_lookup_sender(id *receiver, SEL selector, id sender) OBJC_NONPORTABLE; struct objc_slot *objc_msg_lookup_sender(id *receiver, SEL selector, id sender)
OBJC_NONPORTABLE;
/** /**
* Hook provided to allow libraries to support fast proxies. * Hook provided to allow libraries to support fast proxies.
*/ */
@ -322,8 +328,4 @@ static const id self = nil;
#define objc_msgSendSuper(super, op, ...) objc_msg_lookup_super(super, op)(super->receiver, op, ## __VA_ARGS__) #define objc_msgSendSuper(super, op, ...) objc_msg_lookup_super(super, op)(super->receiver, op, ## __VA_ARGS__)
#else
#include "runtime-legacy.h"
#endif // __LEGACY_GNU_MODE__
#endif // __LIBOBJC_RUNTIME_H_INCLUDED__ #endif // __LIBOBJC_RUNTIME_H_INCLUDED__

@ -208,6 +208,7 @@ __objc_responds_to (id object, SEL sel)
return (res != 0); return (res != 0);
} }
extern id (*objc_proxy_lookup)(id receiver, SEL op);
/* This is the lookup function. All entries in the table are either a /* This is the lookup function. All entries in the table are either a
valid method *or* zero. If zero then either the dispatch table valid method *or* zero. If zero then either the dispatch table
needs to be installed or it doesn't exist and forwarding is attempted. */ needs to be installed or it doesn't exist and forwarding is attempted. */
@ -243,6 +244,16 @@ objc_msg_lookup (id receiver, SEL op)
(sidx)op->sel_id); (sidx)op->sel_id);
if (result == 0) if (result == 0)
{ {
/* Try again after giving the code a chance to install new
* methods. This lookup mechanism doesn't support forwarding
* to other objects, so only call the lookup recursively if
* the receiver is not changed.
*/
id newReceiver = objc_proxy_lookup (receiver, op);
if (newReceiver == receiver)
{
return objc_msg_lookup(receiver, op);
}
/* If the method still just doesn't exist for the /* If the method still just doesn't exist for the
class, attempt to forward the method. */ class, attempt to forward the method. */
result = __objc_get_forward_imp (receiver, op); result = __objc_get_forward_imp (receiver, op);

Loading…
Cancel
Save