ObjFW  Diff

Differences From Artifact [baff938aeb]:

  • File src/OFObject.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: 28951) [annotate] [blame] [check-ins using]

To Artifact [3a0e0599cf]:


50
51
52
53
54
55
56
57
58
59
60
61










62
63
64
65
66
67
68
#if __STDC_VERSION__ >= 201112L
# ifdef OF_HAVE_STDNORETURN_H
#  include <stdnoreturn.h>
# else
#  define noreturn _Noreturn
# endif
#elif defined(__GNUC__)
# define noreturn __attribute__((noreturn))
#else
# define noreturn
#endif











#if defined(OF_HAVE__THREAD_LOCAL)
# define OF_HAVE_COMPILER_TLS
# ifdef OF_HAVE_THREADS_H
#  include <threads.h>
# else
#  define thread_local _Thread_local
# endif







|




>
>
>
>
>
>
>
>
>
>







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#if __STDC_VERSION__ >= 201112L
# ifdef OF_HAVE_STDNORETURN_H
#  include <stdnoreturn.h>
# 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 defined(OF_HAVE__THREAD_LOCAL)
# define OF_HAVE_COMPILER_TLS
# ifdef OF_HAVE_THREADS_H
#  include <threads.h>
# else
#  define thread_local _Thread_local
# endif