ObjFW  Diff

Differences From Artifact [6ce9a1b05b]:

To Artifact [6f2726fb11]:

  • File src/macros.h — part of check-in [b7097a67b6] at 2015-06-14 10:45:10 on branch trunk — Add OF_NONNULL / OF_NULLABLE and use that instead

    Using __nonnull directly doesn't work on systems using glibc, as glibc
    defines __nonnull as a parameterized define. While this does not fix the
    problem of Clang introducing __nonnull even though it conflicts with
    glibc, this at least means it's possible again to compile things with
    versions of Clang that don't support __nonnull on systems with glibc. (user: js, size: 14648) [annotate] [blame] [check-ins using]


173
174
175
176
177
178
179


180
181
182
183
184


185
186
187
188
189
190
191
173
174
175
176
177
178
179
180
181
182
183
184


185
186
187
188
189
190
191
192
193







+
+



-
-
+
+







#else
# define OF_GENERIC(...)
#endif

#if __has_feature(nullability)
# define OF_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
# define OF_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
# define OF_NONNULL __nonnull
# define OF_NULLABLE __nullable
#else
# define OF_ASSUME_NONNULL_BEGIN
# define OF_ASSUME_NONNULL_END
# define __nonnull
# define __nullable
# define OF_NONNULL
# define OF_NULLABLE
# define nonnull
# define nullable
#endif

#if __has_feature(objc_kindof)
# define OF_KINDOF(cls) __kindof cls
#else