Rework the strict aliasing fix to not break C++, pointed out by Murray
authorMatthias Clasen <mclasen@redhat.com>
Mon, 16 Jan 2006 23:03:10 +0000 (23:03 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 16 Jan 2006 23:03:10 +0000 (23:03 +0000)
2006-01-16  Matthias Clasen  <mclasen@redhat.com>

* glib/gthread.h (g_static_mutex_get_mutex_impl_shortcut):
Rework the strict aliasing fix to not break C++, pointed
out by Murray Cumming.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
glib/gthread.h

index 99ee1db..b9c0135 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-01-16  Matthias Clasen  <mclasen@redhat.com>
 
+       * glib/gthread.h (g_static_mutex_get_mutex_impl_shortcut): 
+       Rework the strict aliasing fix to not break C++, pointed
+       out by Murray Cumming.
+       
        * glib/gasyncqueue.c (g_async_queue_push_sorted_unlocked):
        Signal waiting threads, problem noticed by Christian Kellner.
 
index 99ee1db..b9c0135 100644 (file)
@@ -1,5 +1,9 @@
 2006-01-16  Matthias Clasen  <mclasen@redhat.com>
 
+       * glib/gthread.h (g_static_mutex_get_mutex_impl_shortcut): 
+       Rework the strict aliasing fix to not break C++, pointed
+       out by Murray Cumming.
+       
        * glib/gasyncqueue.c (g_async_queue_push_sorted_unlocked):
        Signal waiting threads, problem noticed by Christian Kellner.
 
index 99ee1db..b9c0135 100644 (file)
@@ -1,5 +1,9 @@
 2006-01-16  Matthias Clasen  <mclasen@redhat.com>
 
+       * glib/gthread.h (g_static_mutex_get_mutex_impl_shortcut): 
+       Rework the strict aliasing fix to not break C++, pointed
+       out by Murray Cumming.
+       
        * glib/gasyncqueue.c (g_async_queue_push_sorted_unlocked):
        Signal waiting threads, problem noticed by Christian Kellner.
 
index 2d0170e..2ae313f 100644 (file)
@@ -138,7 +138,7 @@ void    g_thread_init_with_errorcheck_mutexes (GThreadFunctions* vtable);
 GMutex* g_static_mutex_get_mutex_impl   (GMutex **mutex);
 
 #define g_static_mutex_get_mutex_impl_shortcut(mutex) \
-  (g_atomic_pointer_get (mutex) ? *(mutex) : \
+  (g_atomic_pointer_get ((gpointer*)(void*)mutex) ? *(mutex) : \
    g_static_mutex_get_mutex_impl (mutex))
 
 /* shorthands for conditional and unconditional function calls */