[glib: 1/2] glib: Mark various macros as available in certain versions of GLib



commit d196bfa4a4bdba4d251d956363cb5955b02bf0d1
Author: Philip Withnall <withnall endlessm com>
Date:   Mon Aug 26 18:50:16 2019 +0300

    glib: Mark various macros as available in certain versions of GLib
    
    These macros wrap functions which were only introduced in certain
    versions of GLib. The functions are correctly marked as introduced in
    those versions, but the macros aren’t, which can result in not getting
    appropriate deprecation warnings if you’re using those APIs when you
    have said you’re targeting older GLib versions using
    `GLIB_VERSION_MAX_ALLOWED`.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    Closes: #1860

 glib/gmain.h      | 3 ++-
 glib/gmem.h       | 6 ++++--
 gobject/gsignal.h | 3 ++-
 3 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/glib/gmain.h b/glib/gmain.h
index d6f51533c..6325ecbe3 100644
--- a/glib/gmain.h
+++ b/glib/gmain.h
@@ -619,7 +619,8 @@ void    g_clear_handle_id (guint           *tag_ptr,
         *_tag_ptr = 0;                                     \
         clear_func (_handle_id);                           \
       }                                                    \
-  } G_STMT_END
+  } G_STMT_END                                             \
+  GLIB_AVAILABLE_MACRO_IN_2_56
 
 /* Idles, child watchers and timeouts */
 GLIB_AVAILABLE_IN_ALL
diff --git a/glib/gmem.h b/glib/gmem.h
index 81f8cdde3..953a0182d 100644
--- a/glib/gmem.h
+++ b/glib/gmem.h
@@ -119,7 +119,8 @@ gpointer g_try_realloc_n  (gpointer  mem,
     *_pp = NULL;                                                               \
     if (_ptr)                                                                  \
       (destroy) (_ptr);                                                        \
-  } G_STMT_END
+  } G_STMT_END                                                                 \
+  GLIB_AVAILABLE_MACRO_IN_2_34
 #else /* __GNUC__ */
 #define g_clear_pointer(pp, destroy) \
   G_STMT_START {                                                               \
@@ -137,7 +138,8 @@ gpointer g_try_realloc_n  (gpointer  mem,
         *_pp.out = NULL;                                                       \
         _destroy (_p);                                                         \
       }                                                                        \
-  } G_STMT_END
+  } G_STMT_END                                                                 \
+  GLIB_AVAILABLE_MACRO_IN_2_34
 #endif /* __GNUC__ */
 
 /**
diff --git a/gobject/gsignal.h b/gobject/gsignal.h
index 7825a863b..a79b9f662 100644
--- a/gobject/gsignal.h
+++ b/gobject/gsignal.h
@@ -450,7 +450,8 @@ void         g_clear_signal_handler               (gulong            *handler_id_ptr,
         g_signal_handler_disconnect ((instance), _handler_id);      \
         *(handler_id_ptr) = 0;                                      \
       }                                                             \
-  } G_STMT_END
+  } G_STMT_END                                                      \
+  GLIB_AVAILABLE_MACRO_IN_2_62
 
 /* --- overriding and chaining --- */
 GLIB_AVAILABLE_IN_ALL


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