+2008-05-09 Tim-Philipp Müller <tim.muller at collabora co uk>
+
+ * gst/gstutils.h: (GST_BOILERPLATE_FULL):
+ Try to fix 'dereferencing type-punned pointer will break strict
+ aliasing rules' warnings with C++ compilers and GLib >= 2.14.0: GLib
+ changed the default GType typedef from gulong to gsize at some point,
+ but kept GType typedef'ed to gulong for C++ for ABI reasons; the
+ g_once_* functions all take a gsize * though, so work around the type
+ mismatch for C++ by doing everything in gsize and casting to GType
+ later.
+
2008-05-09 Jan Schmidt <jan.schmidt@sun.com>
* plugins/elements/gstmultiqueue.c:
GType \
type_as_function ## _get_type (void) \
{ \
- static volatile GType object_type = 0; \
- if (__gst_once_init_enter ((gsize *) &object_type)) { \
+ /* The typedef for GType may be gulong or gsize, depending on the \
+ * system and whether the compiler is c++ or not. The g_once_init_* \
+ * functions always take a gsize * though ... */ \
+ static volatile gsize gonce_data; \
+ if (__gst_once_init_enter (&gonce_data)) { \
GType _type; \
_type = gst_type_register_static_full (parent_type_macro, \
g_intern_static_string (#type), \
NULL, \
(GTypeFlags) 0); \
additional_initializations (_type); \
- __gst_once_init_leave ((gsize *) &object_type, (gsize) _type); \
+ __gst_once_init_leave (&gonce_data, (gsize) _type); \
} \
- return object_type; \
+ return (GType) gonce_data; \
}
#define __GST_DO_NOTHING(type) /* NOP */