Merge branch 'add-g-has-typeof-1440' into 'master'

gmacros: Add new private g_has_typeof to abstract __typeof__ checks

Closes #1440

See merge request GNOME/glib!172
This commit is contained in:
Philip Withnall
2018-07-17 09:27:12 +00:00
4 changed files with 15 additions and 3 deletions

View File

@@ -507,7 +507,7 @@ GLIB_AVAILABLE_IN_ALL
void g_object_remove_weak_pointer (GObject *object,
gpointer *weak_pointer_location);
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) && !defined(__cplusplus) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56
#if defined(g_has_typeof) && 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))