mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-04 10:16:17 +01:00
gmacros: Use __typeof__ when compiling with Clang
Just like gcc, clang has supported `__typeof__` for a long time, so
allow it to be used. This fixes compilation of `gio/gcredentials.c` on
macOS (which uses clang by default).
I don’t know which version clang started supporting `__typeof__` in, so
there’s no version check. One can be added in future if there are
problems.
This fixes commit 5b2bee3f53
.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
b67185cd92
commit
dce24dc449
@ -232,7 +232,9 @@
|
|||||||
* This symbol is private.
|
* This symbol is private.
|
||||||
*/
|
*/
|
||||||
#undef glib_typeof
|
#undef glib_typeof
|
||||||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) && !defined(__cplusplus)
|
#if !defined(__cplusplus) && \
|
||||||
|
((defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) || \
|
||||||
|
defined(__clang__))
|
||||||
#define glib_typeof(t) __typeof__ (t)
|
#define glib_typeof(t) __typeof__ (t)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user