Differences From Artifact [79cb0c24fe]:
- File src/threading.h — part of check-in [b885b6fdfa] at 2014-05-05 02:43:51 on branch trunk — Add OF_NO_RETURN and OF_UNREACHABLE (user: js, size: 12424) [annotate] [blame] [check-ins using]
To Artifact [65cc15f272]:
- File
src/threading.h
— part of check-in
[bac91ccede]
at
2014-05-14 20:45:00
on branch trunk
— Add C11 noreturn
If it's unavailable, it's defined to __attribute__((noreturn)).
Unfortunately, it cannot be used for ObjC methods, as noreturn is part
of the return type while __attribute__((noreturn)) needs to be at the
end for an ObjC method. To make matters worse, even GCC versions that
accept noreturn don't allow it for an ObjC method. Thus, the only thing
that can be done is to always use __attribute__((noreturn)) for ObjC
methods using the OF_METHOD_NORETURN define. (user: js, size: 12436) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
139 140 141 142 143 144 145 | /* FIXME */ return true; #else # error of_thread_detach not implemented! #endif } | | > | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | /* FIXME */ return true; #else # error of_thread_detach not implemented! #endif } static OF_INLINE void noreturn of_thread_exit(void) { #if defined(OF_HAVE_PTHREADS) pthread_exit(NULL); #elif defined(_WIN32) ExitThread(0); #else # error of_thread_exit not implemented! #endif OF_UNREACHABLE } static OF_INLINE void of_once(of_once_t *control, void (*func)(void)) { #if defined(OF_HAVE_PTHREADS) pthread_once(control, func); |
︙ | ︙ |