[glibmm] thread.h: Move calls to deprecated glib functions into thread.cc.



commit ce45ebe8f61ce55230ef15947612c61c7f283bd2
Author: Haikel Guemar <karlthered gmail com>
Date:   Sun Dec 4 19:01:29 2011 +0100

    thread.h: Move calls to deprecated glib functions into thread.cc.
    
    	* glib/src/thread.[hg|ccg]: Move calls to deprecated glib functions
    	from thread.h into new public helper functions, so they are only
    	used in our .cc file. This avoids warnings in application compiles
    	just because they happen to include this header.

 ChangeLog           |    9 +++++++++
 glib/src/thread.ccg |   12 ++++++++++++
 glib/src/thread.hg  |   18 +++++++++++++++---
 3 files changed, 36 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 82844d1..fc23bd8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-12-08  Haikel Guemar  <karlthered gmail com>
+
+	thread.h: Move calls to deprecated glib functions into thread.cc.
+
+	* glib/src/thread.[hg|ccg]: Move calls to deprecated glib functions 
+	from thread.h into new public helper functions, so they are only
+	used in our .cc file. This avoids warnings in application compiles 
+	just because they happen to include this header.
+
 2.31.2:
 
 2011-11-24  Kjell Ahlstedt  <kjell ahlstedt bredband net>
diff --git a/glib/src/thread.ccg b/glib/src/thread.ccg
index e7d6b06..58853c4 100644
--- a/glib/src/thread.ccg
+++ b/glib/src/thread.ccg
@@ -375,6 +375,18 @@ bool Cond::timed_wait(Mutex& mutex, const Glib::TimeVal& abs_time)
   return g_cond_timed_wait(gobject_, mutex.gobj(), const_cast<Glib::TimeVal*>(&abs_time));
 }
 
+void* StaticPrivate_get_helper(GStaticPrivate *private_key) {
+  return g_static_private_get(private_key);
+}
+
+void StaticPrivate_set_helper(GStaticPrivate *private_key, gpointer data, GDestroyNotify notify) {
+  return g_static_private_set(private_key, data, notify);
+}
+
+GPrivate* GPrivate_new_helper(GDestroyNotify notify) {
+  return g_private_new(notify);
+}
+
 
 } // namespace Glib
 
diff --git a/glib/src/thread.hg b/glib/src/thread.hg
index a007dec..bc91586 100644
--- a/glib/src/thread.hg
+++ b/glib/src/thread.hg
@@ -1025,16 +1025,24 @@ void StaticPrivate<T>::delete_ptr(void* data)
   delete static_cast<T*>(data);
 }
 
+/** This is ony for use by glibmm itself.
+ */
+void* StaticPrivate_get_helper(GStaticPrivate *private_key);
+
 template <class T> inline
 T* StaticPrivate<T>::get()
 {
-  return static_cast<T*>(g_static_private_get(&gobject_));
+  return static_cast<T*>(StaticPrivate_get_helper(&gobject_));
 }
 
+/** This is ony for use by glibmm itself.
+ */
+void StaticPrivate_set_helper(GStaticPrivate *private_key, gpointer data, GDestroyNotify notify);
+
 template <class T> inline
 void StaticPrivate<T>::set(T* data, typename StaticPrivate<T>::DestroyNotifyFunc notify_func)
 {
-  g_static_private_set(&gobject_, data, notify_func);
+  StaticPrivate_set_helper(&gobject_, data, notify_func);
 }
 
 
@@ -1047,10 +1055,14 @@ void Private<T>::delete_ptr(void* data)
   delete static_cast<T*>(data);
 }
 
+/** This is ony for use by glibmm itself.
+ */
+GPrivate* GPrivate_new_helper(GDestroyNotify notify);
+
 template <class T> inline
 Private<T>::Private(typename Private<T>::DestructorFunc destructor_func)
 :
-  gobject_ (g_private_new(destructor_func))
+  gobject_ (GPrivate_new_helper(destructor_func))
 {}
 
 template <class T> inline



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