mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-21 09:27:51 +02:00
glib_typeof: Move definition to its own header
It is cleaner to define glib_typeof() in a header included after gversionmacros.h so we can use GLIB_VERSION_MIN_REQUIRED directly instead of doing it everywhere glib_typeof() is used.
This commit is contained in:
@@ -28,11 +28,6 @@
|
||||
#include <gobject/gsignal.h>
|
||||
#include <gobject/gboxed.h>
|
||||
|
||||
#if defined(glib_typeof_2_68) && GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68
|
||||
/* for glib_typeof */
|
||||
#include <type_traits>
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* --- type macros --- */
|
||||
@@ -518,7 +513,7 @@ GLIB_AVAILABLE_IN_ALL
|
||||
void g_object_remove_weak_pointer (GObject *object,
|
||||
gpointer *weak_pointer_location);
|
||||
|
||||
#if defined(glib_typeof) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56 && (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68)
|
||||
#if defined(glib_typeof) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56
|
||||
/* Make reference APIs type safe with macros */
|
||||
#define g_object_ref(Obj) ((glib_typeof (Obj)) (g_object_ref) (Obj))
|
||||
#define g_object_ref_sink(Obj) ((glib_typeof (Obj)) (g_object_ref_sink) (Obj))
|
||||
|
Reference in New Issue
Block a user