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



commit 5deca51bd8695fd86ec30d6ae4cdc4f5be3922f1
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 | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index c95f2915bd..d76342fa8b 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,20 +1207,16 @@ 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
 }
 
 static inline void
 object_unset_optional_flags (GObject *object,
                             guint flags)
 {
-#ifdef HAVE_OPTIONAL_FLAGS
   GObjectReal *real = (GObjectReal *)object;
   g_atomic_int_and (&real->optional_flags, ~flags);
-#endif
 }
 
 /* Variant for when we have exclusive access
@@ -1231,11 +1226,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]