gobject: ifdef out some inline functions if they’re not used

This prevents `-Wunused-function` warnings on platforms which don’t have
`HAVE_OPTIONAL_FLAGS` defined.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2022-06-14 11:02:53 +01:00
parent 10a1c16b59
commit af7ba68a00

View File

@ -1191,14 +1191,13 @@ object_get_optional_flags_X (GObject *object)
#endif
}
#ifdef HAVE_OPTIONAL_FLAGS
static inline void
object_set_optional_flags (GObject *object,
guint flags)
{
#ifdef HAVE_OPTIONAL_FLAGS
GObjectReal *real = (GObjectReal *)object;
g_atomic_int_or (&real->optional_flags, flags);
#endif
}
/* Variant for when we have exclusive access
@ -1208,10 +1207,8 @@ static inline void
object_set_optional_flags_X (GObject *object,
guint flags)
{
#ifdef HAVE_OPTIONAL_FLAGS
GObjectReal *real = (GObjectReal *)object;
real->optional_flags |= flags;
#endif
}
/* Variant for when we have exclusive access
@ -1221,11 +1218,10 @@ static inline void
object_unset_optional_flags_X (GObject *object,
guint flags)
{
#ifdef HAVE_OPTIONAL_FLAGS
GObjectReal *real = (GObjectReal *)object;
real->optional_flags &= ~flags;
#endif
}
#endif
gboolean
_g_object_has_signal_handler (GObject *object)