structure,capsfeatures: Fix MSVC build warnings

Fixing warning "warning C4068: unknown pragma 'GCC'"

Use portable GLib macro instead

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7589>
This commit is contained in:
Seungha Yang 2024-09-30 23:07:40 +09:00 committed by GStreamer Marge Bot
parent a0b561b492
commit a8f8bbef99
2 changed files with 10 additions and 15 deletions

View file

@ -405,10 +405,9 @@ gst_caps_features_new_id (GQuark feature1, ...)
g_return_val_if_fail (feature1 != 0, NULL);
va_start (varargs, feature1);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
features = gst_caps_features_new_id_valist (feature1, varargs);
#pragma GCC diagnostic pop
G_GNUC_END_IGNORE_DEPRECATIONS;
va_end (varargs);
return features;
@ -437,10 +436,9 @@ gst_caps_features_new_id_valist (GQuark feature1, va_list varargs)
features = gst_caps_features_new_empty ();
while (feature1) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gst_caps_features_add_id (features, feature1);
#pragma GCC diagnostic pop
G_GNUC_END_IGNORE_DEPRECATIONS;
feature1 = va_arg (varargs, GQuark);
}

View file

@ -3860,10 +3860,9 @@ gst_structure_id_get_valist (const GstStructure * structure,
expected_type = va_arg (args, GType);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
val = gst_structure_id_get_value (structure, field_id);
#pragma GCC diagnostic pop
G_GNUC_END_IGNORE_DEPRECATIONS;
if (val == NULL)
goto no_such_field;
@ -3892,15 +3891,14 @@ no_such_field:
}
wrong_type:
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
GST_DEBUG ("Expected field '%s' in structure to be of type '%s', but "
"field was of type '%s': %" GST_PTR_FORMAT,
g_quark_to_string (field_id),
GST_STR_NULL (g_type_name (expected_type)),
G_VALUE_TYPE_NAME (gst_structure_id_get_value (structure, field_id)),
structure);
#pragma GCC diagnostic pop
G_GNUC_END_IGNORE_DEPRECATIONS;
return FALSE;
}
}
@ -4020,10 +4018,9 @@ gst_structure_id_get (const GstStructure * structure, GQuark first_field_id,
g_return_val_if_fail (first_field_id != 0, FALSE);
va_start (args, first_field_id);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
ret = gst_structure_id_get_valist (structure, first_field_id, args);
#pragma GCC diagnostic pop
G_GNUC_END_IGNORE_DEPRECATIONS;
va_end (args);
return ret;