[glib/freeze-shenanigans: 2/2] gobject: ifdef out some inline functions if they’re not used




commit af7ba68a00e855a0a903c5d04d54b84820fedeff
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue Jun 14 11:02:53 2022 +0100

    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>

 gobject/gobject.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 6ef6c3666f..e7f9d05f73 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]