diff --git a/third_party/libobjc/arc.m b/third_party/libobjc/arc.m index b8c6d7cfbe5801a380d939c6232287952de1930b..6bc56b6645f807cfa030ac5825c43bf2c02e9cc4 100644 --- a/third_party/libobjc/arc.m +++ b/third_party/libobjc/arc.m @@ -16,8 +16,8 @@ pthread_key_t ARCThreadKey; #endif -extern void _NSConcreteMallocBlock; -extern void _NSConcreteGlobalBlock; +extern char _NSConcreteMallocBlock; +extern char _NSConcreteGlobalBlock; @interface NSAutoreleasePool + (Class)class; @@ -453,9 +453,9 @@ typedef struct objc_weak_ref } WeakRef; -static int weak_ref_compare(const id obj, const WeakRef weak_ref) +static int weak_ref_compare(const void *obj, const WeakRef weak_ref) { - return obj == weak_ref.obj; + return (id) obj == weak_ref.obj; } static uint32_t ptr_hash(const void *ptr) @@ -528,7 +528,7 @@ id objc_storeWeak(id *addr, id obj) return nil; } Class cls = classForObject(obj); - if (&_NSConcreteGlobalBlock == cls) + if ((Class)&_NSConcreteGlobalBlock == cls) { // If this is a global block, it's never deallocated, so secretly make // this a strong reference @@ -537,7 +537,7 @@ id objc_storeWeak(id *addr, id obj) *addr = obj; return obj; } - if (&_NSConcreteMallocBlock == cls) + if ((Class)&_NSConcreteMallocBlock == cls) { obj = block_load_weak(obj); } @@ -628,7 +628,7 @@ id objc_loadWeakRetained(id* addr) id obj = *addr; if (nil == obj) { return nil; } Class cls = classForObject(obj); - if (&_NSConcreteMallocBlock == cls) + if ((Class)&_NSConcreteMallocBlock == cls) { obj = block_load_weak(obj); } diff --git a/third_party/libobjc/block_to_imp.c b/third_party/libobjc/block_to_imp.c index 5b0262c69c4c229a436b5eae40a42a107813c838..0e748ddc6294287378b2c75e829b8a549c7e71b7 100644 --- a/third_party/libobjc/block_to_imp.c +++ b/third_party/libobjc/block_to_imp.c @@ -65,10 +65,10 @@ static struct wx_buffer alloc_buffer(size_t size) return b; } -extern void __objc_block_trampoline; -extern void __objc_block_trampoline_end; -extern void __objc_block_trampoline_sret; -extern void __objc_block_trampoline_end_sret; +extern char __objc_block_trampoline; +extern char __objc_block_trampoline_end; +extern char __objc_block_trampoline_sret; +extern char __objc_block_trampoline_end_sret; IMP imp_implementationWithBlock(void *block) { diff --git a/third_party/libobjc/blocks_runtime.m b/third_party/libobjc/blocks_runtime.m index 0ba796129d8a822c92c665805799367c4d3dbba4..837a81a94ef18066504ec754d375bcdfb0104d58 100644 --- a/third_party/libobjc/blocks_runtime.m +++ b/third_party/libobjc/blocks_runtime.m @@ -237,8 +237,8 @@ void *_Block_copy(void *src) struct Block_layout *self = src; struct Block_layout *ret = self; - extern void _NSConcreteStackBlock; - extern void _NSConcreteMallocBlock; + extern char _NSConcreteStackBlock; + extern char _NSConcreteMallocBlock; // If the block is Global, there's no need to copy it on the heap. if(self->isa == &_NSConcreteStackBlock) @@ -270,8 +270,8 @@ void _Block_release(void *src) if (NULL == src) { return; } struct Block_layout *self = src; - extern void _NSConcreteStackBlock; - extern void _NSConcreteMallocBlock; + extern char _NSConcreteStackBlock; + extern char _NSConcreteMallocBlock; if (&_NSConcreteStackBlock == self->isa) { diff --git a/third_party/libobjc/lock.h b/third_party/libobjc/lock.h index 527c8714f845b968ef8bdb5ecbc346baa08b3ce2..1ec7a68d999a9fb6d3b03884b6d3cfc2aae81f4d 100644 --- a/third_party/libobjc/lock.h +++ b/third_party/libobjc/lock.h @@ -22,12 +22,7 @@ typedef HANDLE mutex_t; typedef pthread_mutex_t mutex_t; // If this pthread implementation has a static initializer for recursive // mutexes, use that, otherwise fall back to the portable version -# ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP -# define INIT_LOCK(x) x = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP -# elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER) -# define INIT_LOCK(x) x = PTHREAD_RECURSIVE_MUTEX_INITIALIZER -# else -# define INIT_LOCK(x) init_recursive_mutex(&(x)) +# define INIT_LOCK(x) init_recursive_mutex(&(x)) static inline void init_recursive_mutex(pthread_mutex_t *x) { @@ -37,7 +32,6 @@ static inline void init_recursive_mutex(pthread_mutex_t *x) pthread_mutex_init(x, &recursiveAttributes); pthread_mutexattr_destroy(&recursiveAttributes); } -# endif # define LOCK(x) pthread_mutex_lock(x) # define UNLOCK(x) pthread_mutex_unlock(x)