From 16c3ec8f46dc3f90a34ebf2692f9c15d1e5469fd Mon Sep 17 00:00:00 2001 From: theraven Date: Sat, 2 Jan 2010 17:45:10 +0000 Subject: [PATCH] Correctly declare the runtime hooks as extern. Was causing copies of them to show up in the uninitialised data section of libraries that included runtime.h, clobbering the default version and causing a crash when the runtime tried to call them. --- objc/runtime.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/objc/runtime.h b/objc/runtime.h index f6d3c67..7f23595 100644 --- a/objc/runtime.h +++ b/objc/runtime.h @@ -312,23 +312,23 @@ struct objc_slot * New ABI lookup function. Receiver may be modified during lookup or proxy * forwarding and the sender may affect how lookup occurs. */ -struct objc_slot *objc_msg_lookup_sender(id *receiver, SEL selector, id sender) +extern struct objc_slot *objc_msg_lookup_sender(id *receiver, SEL selector, id sender) OBJC_NONPORTABLE; /** * Hook provided to allow libraries to support fast proxies. */ -id (*objc_proxy_lookup)(id receiver, SEL op) OBJC_NONPORTABLE; +extern id (*objc_proxy_lookup)(id receiver, SEL op) OBJC_NONPORTABLE; /** * New message lookup hook. This returns a slot, rather than an IMP. The * version should be set to 0 to disable caching. */ -struct objc_slot *(*objc_msg_forward3)(id receiver, SEL op) OBJC_NONPORTABLE; +extern struct objc_slot *(*objc_msg_forward3)(id receiver, SEL op) OBJC_NONPORTABLE; /** * Runtime hook for unhandled exceptions. This is called if an exception is * not caught. */ -void (*__objc_unhandled_exception)(id); +extern void (*__objc_unhandled_exception)(id); // Global self so that self is a valid symbol everywhere. Will be replaced by // a real self in an inner scope if there is one.