@@ -16,10 +16,13 @@ #include "config.h" #include +#import "runtime.h" +#import "runtime-private.h" + #import "OFObject.h" #import "macros.h" #ifdef OF_THREADS # import "threading.h" @@ -26,23 +29,21 @@ # define NUM_SPINLOCKS 8 /* needs to be a power of 2 */ # define SPINLOCK_HASH(p) ((unsigned)((uintptr_t)p >> 4) & (NUM_SPINLOCKS - 1)) static of_spinlock_t spinlocks[NUM_SPINLOCKS]; #endif -BOOL -objc_properties_init(void) -{ #ifdef OF_THREADS +static void __attribute__((constructor)) +init(void) +{ size_t i; for (i = 0; i < NUM_SPINLOCKS; i++) if (!of_spinlock_new(&spinlocks[i])) - return NO; -#endif - - return YES; + OBJC_ERROR("Failed to initialize spinlocks!") } +#endif id objc_getProperty(id self, SEL _cmd, ptrdiff_t offset, BOOL atomic) { if (atomic) {