mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Use escaped version of typeof
When compiling code that includes gobject.h using GCC with the ISO standard, the `typeof` keyword is disabled, as it's a GCC extension. The GCC documentation recommends: > If you are writing a header file that must work when included in > ISO C programs, write __typeof__ instead of typeof. Which is precisely what we're going to do. Signed-off-by: Emmanuele Bassi <ebassi@gnome.org> Reviewed-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=790697
This commit is contained in:
parent
3fae39a5d7
commit
9f3f089e60
@ -510,8 +510,8 @@ void g_object_remove_weak_pointer (GObject *object,
|
||||
|
||||
#if defined(__GNUC__) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56
|
||||
/* Make reference APIs type safe with macros */
|
||||
#define g_object_ref(Obj) ((typeof(Obj)) (g_object_ref) (Obj))
|
||||
#define g_object_ref_sink(Obj) ((typeof(Obj)) (g_object_ref_sink) (Obj))
|
||||
#define g_object_ref(Obj) ((__typeof__(Obj)) (g_object_ref) (Obj))
|
||||
#define g_object_ref_sink(Obj) ((__typeof__(Obj)) (g_object_ref_sink) (Obj))
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user