Index: src/OFApplication.h ================================================================== --- src/OFApplication.h +++ src/OFApplication.h @@ -162,18 +162,18 @@ + (OFDictionary*)environment; /*! * @brief Terminates the application. */ -+ (void)terminate OF_METHOD_NORETURN; ++ (void)terminate OF_NO_RETURN; /*! * @brief Terminates the application with the specified status. * * @param status The status with which the application will terminate */ -+ (void)terminateWithStatus: (int)status OF_METHOD_NORETURN; ++ (void)terminateWithStatus: (int)status OF_NO_RETURN; /*! * @brief Gets args and argv. * * @param argc A pointer where a pointer to argc should be stored @@ -218,18 +218,18 @@ - (void)setDelegate: (id )delegate; /*! * @brief Terminates the application. */ -- (void)terminate OF_METHOD_NORETURN; +- (void)terminate OF_NO_RETURN; /*! * @brief Terminates the application with the specified status. * * @param status The status with which the application will terminate */ -- (void)terminateWithStatus: (int)status OF_METHOD_NORETURN; +- (void)terminateWithStatus: (int)status OF_NO_RETURN; @end @interface OFObject (OFApplicationDelegate) @end Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -880,11 +880,11 @@ * @warning If you override this method, you must make sure that it never * returns. * * @param selector The selector not understood by the receiver */ -- (void)doesNotRecognizeSelector: (SEL)selector OF_METHOD_NORETURN; +- (void)doesNotRecognizeSelector: (SEL)selector OF_NO_RETURN; @end /*! * @protocol OFCopying OFObject.h ObjFW/OFObject.h * Index: src/OFThread.h ================================================================== --- src/OFThread.h +++ src/OFThread.h @@ -143,18 +143,18 @@ #ifdef OF_HAVE_THREADS /*! * @brief Terminates the current thread, letting it return nil. */ -+ (void)terminate OF_METHOD_NORETURN; ++ (void)terminate OF_NO_RETURN; /*! * @brief Terminates the current thread, letting it return the specified object. * * @param object The object which the terminated thread will return */ -+ (void)terminateWithObject: (id)object OF_METHOD_NORETURN; ++ (void)terminateWithObject: (id)object OF_NO_RETURN; # ifdef OF_HAVE_BLOCKS /*! * @brief Initializes an already allocated thread with the specified block. * Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -240,12 +240,12 @@ { [self terminateWithObject: nil]; /* * For some reason, Clang thinks terminateWithObject: can return - even - * though it is declared noreturn - and warns that terminate returns - * while being declared noreturn. + * though it is declared OF_NO_RETURN - and warns that terminate + * returns while being declared OF_NO_RETURN. */ OF_UNREACHABLE } + (void)terminateWithObject: (id)object Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -42,32 +42,10 @@ # define restrict __restrict__ #elif __STDC_VERSION__ < 199901L # define restrict #endif -#if __STDC_VERSION__ >= 201112L -# ifdef OF_HAVE_STDNORETURN_H -# include -# else -# define noreturn _Noreturn -# endif -#elif defined(__GNUC__) -# define noreturn __attribute__((__noreturn__)) -#else -# define noreturn -#endif - -/* - * Work around Apple's libc headers breaking by defining noreturn. - * They use __attribute__((noreturn)) where they should be using - * __attribute__((__noreturn__)). - */ -#if defined(__APPLE__) && defined(__dead2) -# undef __dead2 -# define __dead2 __attribute__((__noreturn__)) -#endif - #if __STDC_VERSION__ >= 201112L && !defined(static_assert) /* C11 compiler, but old libc */ # define static_assert _Static_assert #endif @@ -175,14 +153,14 @@ # define OF_UNREACHABLE abort(); #endif #if defined(__clang__) || __GCC_VERSION__ >= 406 # define OF_SENTINEL __attribute__((__sentinel__)) -# define OF_METHOD_NORETURN __attribute__((__noreturn__)) +# define OF_NO_RETURN __attribute__((__noreturn__)) #else # define OF_SENTINEL -# define OF_METHOD_NORETURN +# define OF_NO_RETURN #endif #if __has_attribute(__objc_requires_super__) # define OF_REQUIRES_SUPER __attribute__((__objc_requires_super__)) #else Index: src/threading.h ================================================================== --- src/threading.h +++ src/threading.h @@ -87,11 +87,11 @@ #endif extern bool of_thread_new(of_thread_t *thread, id (*function)(id), id data); extern bool of_thread_join(of_thread_t thread); extern bool of_thread_detach(of_thread_t thread); -extern void noreturn of_thread_exit(void); +extern void OF_NO_RETURN of_thread_exit(void); extern void of_once(of_once_t *control, void (*func)(void)); extern bool of_mutex_new(of_mutex_t *mutex); extern bool of_mutex_lock(of_mutex_t *mutex); extern bool of_mutex_trylock(of_mutex_t *mutex); extern bool of_mutex_unlock(of_mutex_t *mutex); Index: src/threading.m ================================================================== --- src/threading.m +++ src/threading.m @@ -69,11 +69,11 @@ #else # error of_thread_detach not implemented! #endif } -void noreturn +void OF_NO_RETURN of_thread_exit(void) { #if defined(OF_HAVE_PTHREADS) pthread_exit(NULL); #elif defined(_WIN32)