glib r6691 - in trunk: . glib
- From: sdroege svn gnome org
- To: svn-commits-list gnome org
- Subject: glib r6691 - in trunk: . glib
- Date: Wed, 12 Mar 2008 15:36:39 +0000 (GMT)
Author: sdroege
Date: Wed Mar 12 15:36:38 2008
New Revision: 6691
URL: http://svn.gnome.org/viewvc/glib?rev=6691&view=rev
Log:
Bug 316221 - G_LOCK warns about breaking strict-aliasing rules
* configure.in:
* glib/gthread.h: Prevent the compiler from warning about breaking
strict-aliasing rules when using gcc 4.3 and G_LOCK on C sources.
Modified:
trunk/ChangeLog
trunk/configure.in
trunk/glib/gthread.h
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Wed Mar 12 15:36:38 2008
@@ -2820,9 +2820,15 @@
} static_mutex;
};
#define G_STATIC_MUTEX_INIT { NULL, { { $g_mutex_contents} } }
+#ifdef __cplusplus
#define g_static_mutex_get_mutex(mutex) \\
(g_thread_use_default_impl ? ((GMutex*) ((mutex)->static_mutex.pad)) : \\
g_static_mutex_get_mutex_impl_shortcut (&((mutex)->runtime_mutex)))
+#else
+#define g_static_mutex_get_mutex(mutex) \\
+ (g_thread_use_default_impl ? ((GMutex*) (void*) ((mutex)->static_mutex.pad)) : \\
+ g_static_mutex_get_mutex_impl_shortcut (&((mutex)->runtime_mutex)))
+#endif
_______EOF
else
cat >>$outfile <<_______EOF
Modified: trunk/glib/gthread.h
==============================================================================
--- trunk/glib/gthread.h (original)
+++ trunk/glib/gthread.h Wed Mar 12 15:36:38 2008
@@ -140,9 +140,15 @@
/* internal function for fallback static mutex implementation */
GMutex* g_static_mutex_get_mutex_impl (GMutex **mutex);
+#ifdef __cplusplus
#define g_static_mutex_get_mutex_impl_shortcut(mutex) \
(g_atomic_pointer_get ((gpointer*)(void*)mutex) ? *(mutex) : \
g_static_mutex_get_mutex_impl (mutex))
+#else
+#define g_static_mutex_get_mutex_impl_shortcut(mutex) \
+ (g_atomic_pointer_get (mutex) ? *(mutex) : \
+ g_static_mutex_get_mutex_impl (mutex))
+#endif
/* shorthands for conditional and unconditional function calls */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]