[glibmm/glibmm-2-60] Glib::Object, Thread: Use G_GNUC_{BEGIN, END}_IGNORE_DEPRECATIONS



commit 561ef94f856f6dc33246a70bcd11d24f6c1f30d5
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Sun Jun 30 13:43:19 2019 +0200

    Glib::Object, Thread: Use G_GNUC_{BEGIN,END}_IGNORE_DEPRECATIONS
    
    * glib/glibmm/object.[h|cc]: GParameter is really deprecated (not just
    mentioned in a comment). Use G_GNUC_{BEGIN,END}_IGNORE_DEPRECATIONS
    to avoid warnings.
    * glib/src/thread.hg: GLib ignores G_DISABLE_DEPRECATED.
    Use G_GNUC_{BEGIN,END}_IGNORE_DEPRECATIONS to avoid warnings.

 glib/glibmm/object.cc | 6 +++++-
 glib/glibmm/object.h  | 2 ++
 glib/src/thread.hg    | 5 +++++
 3 files changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/glib/glibmm/object.cc b/glib/glibmm/object.cc
index c8370d7d..2fa09107 100644
--- a/glib/glibmm/object.cc
+++ b/glib/glibmm/object.cc
@@ -91,10 +91,12 @@ ConstructParams::ConstructParams(
       break;
     }
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
     if (n_parameters >= n_alloced_params)
       parameters = g_renew(GParameter, parameters, n_alloced_params += 8);
 
     GParameter& param = parameters[n_parameters];
+G_GNUC_END_IGNORE_DEPRECATIONS
 
     param.name = name;
     param.value.g_type = 0;
@@ -132,6 +134,7 @@ ConstructParams::~ConstructParams() noexcept
  * usage contexts.  This implementation is fully functional, but unlikely
  * to be ever actually called due to optimization.
  */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 ConstructParams::ConstructParams(const ConstructParams& other)
 : glibmm_class(other.glibmm_class),
   n_parameters(other.n_parameters),
@@ -146,6 +149,7 @@ ConstructParams::ConstructParams(const ConstructParams& other)
     g_value_copy(&other.parameters[i].value, &parameters[i].value);
   }
 }
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 /**** Glib::Object_Class ***************************************************/
 
@@ -230,7 +234,7 @@ Object::Object(const Glib::ConstructParams& construct_params)
 
   G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   //TODO: Replace g_object_newv() by g_object_new_with_properties() when we can
-  // require glib 2.54. GParameter is also deprecated (only mentioned in a comment).
+  // require glib 2.54. GParameter is also deprecated.
   // Don't use it in ConstructParams when we can break ABI.
   void* const new_object =
     g_object_newv(object_type, construct_params.n_parameters, construct_params.parameters);
diff --git a/glib/glibmm/object.h b/glib/glibmm/object.h
index 79b37b53..f9f316a4 100644
--- a/glib/glibmm/object.h
+++ b/glib/glibmm/object.h
@@ -70,7 +70,9 @@ class ConstructParams
 public:
   const Glib::Class& glibmm_class;
   unsigned int n_parameters;
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   GParameter* parameters;
+G_GNUC_END_IGNORE_DEPRECATIONS
 
   explicit ConstructParams(const Glib::Class& glibmm_class_);
   ConstructParams(const Glib::Class& glibmm_class_, const char* first_property_name,
diff --git a/glib/src/thread.hg b/glib/src/thread.hg
index 8763f87c..c98a06ea 100644
--- a/glib/src/thread.hg
+++ b/glib/src/thread.hg
@@ -26,6 +26,7 @@ _IS_DEPRECATED // This whole file is deprecated.
 
 // We use GThreadFunctions in the (deprecated) API, so we must temporarily undef G_DISABLE_DEPRECATED.
 // Temporarily undef G_DISABLE_DEPRECATED, redefining it later if appropriate.
+// GLib ignores G_DISABLE_DEPRECATED since glib 2.61.2.
 #if defined(G_DISABLE_DEPRECATED) && !defined(GLIBMM_G_DISABLE_DEPRECATED_UNDEFED)
 //Stop the deprecation ifdef guards around the API declarations:
 #undef G_DISABLE_DEPRECATED
@@ -47,6 +48,9 @@ _IS_DEPRECATED // This whole file is deprecated.
 
 #include <cstddef>
 
+// Necessary for glib 2.61.2 and newer.
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 /* Shadow THREAD_PRIORITY_NORMAL macro (from winbase.h).
  */
 #if defined(THREAD_PRIORITY_NORMAL) && !defined(GLIBMM_MACRO_SHADOW_THREAD_PRIORITY_NORMAL)
@@ -1082,3 +1086,4 @@ void Private<T>::set(T* data)
 
 } // namespace Glib
 
+G_GNUC_END_IGNORE_DEPRECATIONS


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