mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 17:00:08 +01:00
nm-glib.h: fix compatibility wrapper for g_variant_new_take_string()
g_variant_new_from_bytes() is itself only available since 2.36, thus using it triggers a deprecation warning itself.
This commit is contained in:
parent
a657fc39ce
commit
6d2680acf1
1 changed files with 10 additions and 1 deletions
|
|
@ -420,7 +420,16 @@ _nm_g_strv_contains (const gchar * const *strv,
|
|||
static inline GVariant *
|
||||
_nm_g_variant_new_take_string (gchar *string)
|
||||
{
|
||||
#if !GLIB_CHECK_VERSION(2, 38, 0)
|
||||
#if !GLIB_CHECK_VERSION(2, 36, 0)
|
||||
GVariant *value;
|
||||
|
||||
g_return_val_if_fail (string != NULL, NULL);
|
||||
g_return_val_if_fail (g_utf8_validate (string, -1, NULL), NULL);
|
||||
|
||||
value = g_variant_new_string (string);
|
||||
g_free (string);
|
||||
return value;
|
||||
#elif !GLIB_CHECK_VERSION(2, 38, 0)
|
||||
GVariant *value;
|
||||
GBytes *bytes;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue