Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -959,11 +959,11 @@ OBJCFLAGS="$OBJCFLAGS -Wcast-align" AC_MSG_CHECKING(whether -Wcast-align is buggy) AC_TRY_COMPILE([ #ifdef __has_attribute # if __has_attribute(objc_root_class) - __attribute__((objc_root_class)) + __attribute__((__objc_root_class__)) # endif #endif @interface Foo { struct objc_class *_isa; Index: src/OFBlock.m ================================================================== --- src/OFBlock.m +++ src/OFBlock.m @@ -121,11 +121,11 @@ 8, sizeof(module), NULL, (struct objc_abi_symtab*)&symtab }; extern void __objc_exec_class(struct objc_abi_module*); -static void __attribute__((constructor)) +static void __attribute__((__constructor__)) constructor(void) { __objc_exec_class(&module); } /* End of ObjC module */ Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -102,25 +102,25 @@ # define false ((bool)0) # endif #endif #if defined(__clang__) || __GCC_VERSION__ >= 406 -# define OF_SENTINEL __attribute__((sentinel)) -# define OF_NO_RETURN __attribute__((noreturn)) +# define OF_SENTINEL __attribute__((__sentinel__)) +# define OF_NO_RETURN __attribute__((__noreturn__)) #else # define OF_SENTINEL # define OF_NO_RETURN #endif -#if __has_attribute(objc_requires_super) -# define OF_REQUIRES_SUPER __attribute__((objc_requires_super)) +#if __has_attribute(__objc_requires_super__) +# define OF_REQUIRES_SUPER __attribute__((__objc_requires_super__)) #else # define OF_REQUIRES_SUPER #endif -#if __has_attribute(objc_root_class) -# define OF_ROOT_CLASS __attribute__((objc_root_class)) +#if __has_attribute(__objc_root_class__) +# define OF_ROOT_CLASS __attribute__((__objc_root_class__)) #else # define OF_ROOT_CLASS #endif #ifdef OF_APPLE_RUNTIME @@ -155,15 +155,16 @@ # endif # endif #endif #if __has_feature(objc_arc) -# define OF_RETURNS_RETAINED __attribute__((ns_returns_retained)) -# define OF_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) -# define OF_RETURNS_INNER_POINTER __attribute__((objc_returns_inner_pointer)) -# define OF_CONSUMED __attribute__((ns_consumed)) -# define OF_WEAK_UNAVAILABLE __attribute__((objc_arc_weak_unavailable)) +# define OF_RETURNS_RETAINED __attribute__((__ns_returns_retained__)) +# define OF_RETURNS_NOT_RETAINED __attribute__((__ns_returns_not_retained__)) +# define OF_RETURNS_INNER_POINTER \ + __attribute__((__objc_returns_inner_pointer__)) +# define OF_CONSUMED __attribute__((__ns_consumed__)) +# define OF_WEAK_UNAVAILABLE __attribute__((__objc_arc_weak_unavailable__)) #else # define OF_RETURNS_RETAINED # define OF_RETURNS_NOT_RETAINED # define OF_RETURNS_INNER_POINTER # define OF_CONSUMED Index: src/autorelease.m ================================================================== --- src/autorelease.m +++ src/autorelease.m @@ -40,11 +40,11 @@ static id *top = NULL; static size_t size = 0; #endif #if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS) -static void __attribute__((constructor)) +static void __attribute__((__constructor__)) init(void) { OF_ENSURE(of_tlskey_new(&objectsKey)); OF_ENSURE(of_tlskey_new(&topKey)); OF_ENSURE(of_tlskey_new(&sizeKey)); Index: src/foundation-compat.m ================================================================== --- src/foundation-compat.m +++ src/foundation-compat.m @@ -53,11 +53,11 @@ [OFAutoreleasePool addObject: self]; return self; } -static void __attribute__((constructor)) +static void __attribute__((__constructor__)) init(void) { Class NSAutoreleasePool = objc_getClass("NSAutoreleasePool"); Class NSObject = objc_getClass("NSObject"); Method allocMethod; Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -25,14 +25,14 @@ #if defined(OF_APPLE_RUNTIME) # import #endif #ifdef __GNUC__ -# define OF_INLINE inline __attribute__((always_inline)) +# define OF_INLINE inline __attribute__((__always_inline__)) # define OF_LIKELY(cond) (__builtin_expect(!!(cond), 1)) # define OF_UNLIKELY(cond) (__builtin_expect(!!(cond), 0)) -# define OF_CONST_FUNC __attribute__((const)) +# define OF_CONST_FUNC __attribute__((__const__)) #else # define OF_INLINE inline # define OF_LIKELY(cond) cond # define OF_UNLIKELY(cond) cond # define OF_CONST_FUNC Index: src/resolver.m ================================================================== --- src/resolver.m +++ src/resolver.m @@ -43,11 +43,11 @@ #import "socket_helpers.h" #if !defined(HAVE_THREADSAFE_GETADDRINFO) && defined(OF_HAVE_THREADS) static of_mutex_t mutex; -static void __attribute__((constructor)) +static void __attribute__((__constructor__)) init(void) { if (!of_mutex_new(&mutex)) @throw [OFInitializationFailedException exception]; } Index: src/runtime/class.m ================================================================== --- src/runtime/class.m +++ src/runtime/class.m @@ -77,11 +77,11 @@ for (i = 0; i < ml->count; i++) objc_register_selector( (struct objc_abi_selector*)&ml->methods[i]); } -inline Class __attribute__((gnu_inline)) +inline Class __attribute__((__gnu_inline__)) objc_classname_to_class(const char *name, bool cache) { Class c; if (classes == NULL) Index: src/runtime/property.m ================================================================== --- src/runtime/property.m +++ src/runtime/property.m @@ -30,11 +30,11 @@ # define SPINLOCK_HASH(p) ((unsigned)((uintptr_t)p >> 4) & (NUM_SPINLOCKS - 1)) static of_spinlock_t spinlocks[NUM_SPINLOCKS]; #endif #ifdef OF_HAVE_THREADS -static void __attribute__((constructor)) +static void __attribute__((__constructor__)) init(void) { size_t i; for (i = 0; i < NUM_SPINLOCKS; i++) Index: src/runtime/protocol.m ================================================================== --- src/runtime/protocol.m +++ src/runtime/protocol.m @@ -22,17 +22,17 @@ #import "runtime-private.h" @implementation Protocol @end -inline const char* __attribute__((gnu_inline)) +inline const char* __attribute__((__gnu_inline__)) protocol_getName(Protocol *p) { return p->name; } -inline bool __attribute__((gnu_inline)) +inline bool __attribute__((__gnu_inline__)) protocol_isEqual(Protocol *a, Protocol *b) { return (strcmp(protocol_getName(a), protocol_getName(b)) == 0); } Index: src/runtime/runtime.h ================================================================== --- src/runtime/runtime.h +++ src/runtime/runtime.h @@ -32,12 +32,12 @@ # define OBJC_UNSAFE_UNRETAINED __unsafe_unretained #else # define OBJC_UNSAFE_UNRETAINED #endif -#if __has_attribute(objc_root_class) -# define OBJC_ROOT_CLASS __attribute__((objc_root_class)) +#if __has_attribute(__objc_root_class__) +# define OBJC_ROOT_CLASS __attribute__((__objc_root_class__)) #else # define OBJC_ROOT_CLASS #endif #define Nil (Class)0 Index: src/runtime/synchronized.m ================================================================== --- src/runtime/synchronized.m +++ src/runtime/synchronized.m @@ -32,11 +32,11 @@ struct lock_s *next; } *locks = NULL; static of_mutex_t mutex; -static void __attribute__((constructor)) +static void __attribute__((__constructor__)) init(void) { if (!of_mutex_new(&mutex)) OBJC_ERROR("Failed to create mutex!") }