gst: use #if GLIB_CHECK_VERSION instead of #ifndef GLIBMACRO

for better greppability at the time we bump GLib version requirements.
This commit is contained in:
Tim-Philipp Müller 2010-03-16 17:56:13 +00:00
parent 504f9c7a6c
commit 235910e227
4 changed files with 13 additions and 13 deletions

View file

@ -940,11 +940,11 @@ gst_caps_set_simple_valist (GstCaps * caps, const char *field, va_list varargs)
g_warning ("Don't use G_TYPE_DATE, use GST_TYPE_DATE instead\n");
type = GST_TYPE_DATE;
}
#ifndef G_VALUE_COLLECT_INIT
#if GLIB_CHECK_VERSION(2,23,3)
G_VALUE_COLLECT_INIT (&value, type, varargs, 0, &err);
#else
g_value_init (&value, type);
G_VALUE_COLLECT (&value, varargs, 0, &err);
#else
G_VALUE_COLLECT_INIT (&value, type, varargs, 0, &err);
#endif
if (G_UNLIKELY (err)) {
g_critical ("%s", err);

View file

@ -388,12 +388,12 @@ gst_child_proxy_set_valist (GstObject * object,
if (!gst_child_proxy_lookup (object, name, &target, &pspec))
goto not_found;
#ifndef G_VALUE_COLLECT_INIT
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
G_VALUE_COLLECT (&value, var_args, G_VALUE_NOCOPY_CONTENTS, &error);
#else
#if GLIB_CHECK_VERSION(2,23,3)
G_VALUE_COLLECT_INIT (&value, pspec->value_type, var_args,
G_VALUE_NOCOPY_CONTENTS, &error);
#else
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
G_VALUE_COLLECT (&value, var_args, G_VALUE_NOCOPY_CONTENTS, &error);
#endif
if (error)
goto cant_copy;

View file

@ -517,11 +517,11 @@ gst_structure_set_valist (GstStructure * structure,
g_warning ("Don't use G_TYPE_DATE, use GST_TYPE_DATE instead\n");
type = GST_TYPE_DATE;
}
#ifndef G_VALUE_COLLECT_INIT
#if GLIB_CHECK_VERSION(2,23,3)
G_VALUE_COLLECT_INIT (&field.value, type, varargs, 0, &err);
#else
g_value_init (&field.value, type);
G_VALUE_COLLECT (&field.value, varargs, 0, &err);
#else
G_VALUE_COLLECT_INIT (&field.value, type, varargs, 0, &err);
#endif
if (G_UNLIKELY (err)) {
g_critical ("%s", err);

View file

@ -957,11 +957,11 @@ gst_tag_list_add_valist (GstTagList * list, GstTagMergeMode mode,
g_warning ("unknown tag '%s'", tag);
return;
}
#ifndef G_VALUE_COLLECT_INIT
#if GLIB_CHECK_VERSION(2,23,3)
G_VALUE_COLLECT_INIT (&value, info->type, var_args, 0, &error);
#else
g_value_init (&value, info->type);
G_VALUE_COLLECT (&value, var_args, 0, &error);
#else
G_VALUE_COLLECT_INIT (&value, info->type, var_args, 0, &error);
#endif
if (error) {
g_warning ("%s: %s", G_STRLOC, error);