mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 09:30:31 +01:00
build: avoid GValueArray deprecation warnings
Avoid warnings about GValueArray being deprecated by adding macros that wrap G_GNUC_BEGIN_IGNORE_DEPRECATIONS / G_GNUC_END_IGNORE_DEPRECATIONS around the GValueArray calls.
This commit is contained in:
parent
3bd867bb62
commit
ed9e2d8377
9 changed files with 114 additions and 0 deletions
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
#include "nm-dispatcher-action.h"
|
||||
#include "nm-dispatcher-utils.h"
|
||||
#include "nm-glib-compat.h"
|
||||
|
||||
#define NMD_SCRIPT_DIR NMCONFDIR "/dispatcher.d"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ EXTRA_DIST = \
|
|||
NetworkManagerVPN.h \
|
||||
nm-dbus-glib-types.h \
|
||||
nm-glib-compat.h \
|
||||
nm-gvaluearray-compat.h \
|
||||
nm-test-helpers.h \
|
||||
nm-version.h.in \
|
||||
nm-settings-flags.h
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@
|
|||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "nm-gvaluearray-compat.h"
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2,31,0)
|
||||
#define g_value_set_schar g_value_set_char
|
||||
#define g_value_get_schar g_value_get_char
|
||||
|
|
|
|||
103
include/nm-gvaluearray-compat.h
Normal file
103
include/nm-gvaluearray-compat.h
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
||||
/* NetworkManager -- Network link manager
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright 2013 Red Hat, Inc.
|
||||
*/
|
||||
|
||||
#ifndef NM_GVALUEARRAY_COMPAT_H
|
||||
#define NM_GVALUEARRAY_COMPAT_H
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#define g_value_array_get_type() \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
g_value_array_get_type (); \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||
})
|
||||
|
||||
#define g_value_array_get_nth(value_array, index_) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
g_value_array_get_nth (value_array, index_); \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||
})
|
||||
|
||||
#define g_value_array_new(n_prealloced) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
g_value_array_new (n_prealloced); \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||
})
|
||||
|
||||
#define g_value_array_free(value_array) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
g_value_array_free (value_array); \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||
})
|
||||
|
||||
#define g_value_array_copy(value_array) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
g_value_array_copy (value_array); \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||
})
|
||||
|
||||
#define g_value_array_prepend(value_array, value) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
g_value_array_prepend (value_array, value); \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||
})
|
||||
|
||||
#define g_value_array_append(value_array, value) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
g_value_array_append (value_array, value); \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||
})
|
||||
|
||||
#define g_value_array_insert(value_array, index_, value) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
g_value_array_insert (value_array, index_, value); \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||
})
|
||||
|
||||
#define g_value_array_remove(value_array, index_) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
g_value_array_remove (value_array, index_); \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||
})
|
||||
|
||||
#define g_value_array_sort(value_array, compare_func) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
g_value_array_sort (value_array, compare_func); \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||
})
|
||||
|
||||
#define g_value_array_sort_with_data(value_array, compare_func, user_data) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
g_value_array_sort_with_data (value_array, compare_func, user_data); \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||
})
|
||||
|
||||
#endif /* NM_GVALUEARRAY_COMPAT_H */
|
||||
|
|
@ -42,6 +42,7 @@
|
|||
#include "nm-utils.h"
|
||||
#include "nm-utils-private.h"
|
||||
#include "NetworkManager.h"
|
||||
#include "nm-glib-compat.h"
|
||||
#include "nm-dbus-glib-types.h"
|
||||
#include "nm-setting-ip4-config.h"
|
||||
#include "nm-setting-ip6-config.h"
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include "nm-setting-pppoe.h"
|
||||
#include "nm-setting-serial.h"
|
||||
#include "nm-dbus-glib-types.h"
|
||||
#include "nm-glib-compat.h"
|
||||
|
||||
static void
|
||||
vpn_check_func (const char *key, const char *value, gpointer user_data)
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "NetworkManagerUtils.h"
|
||||
#include "nm-device-private.h"
|
||||
#include "nm-dbus-glib-types.h"
|
||||
#include "nm-glib-compat.h"
|
||||
|
||||
G_DEFINE_TYPE (NMModemGeneric, nm_modem_generic, NM_TYPE_MODEM)
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include "nm-logging.h"
|
||||
#include "nm-dbus-manager.h"
|
||||
#include "nm-dbus-glib-types.h"
|
||||
#include "nm-glib-compat.h"
|
||||
|
||||
static GSList *requests = NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "nm-dbus-glib-types.h"
|
||||
#include "nm-glib-compat.h"
|
||||
#include "nm-system-config-interface.h"
|
||||
#include "reader.h"
|
||||
#include "common.h"
|
||||
|
|
@ -375,8 +376,10 @@ ip_address_or_route_parser (NMSetting *setting, const char *key, GKeyFile *keyfi
|
|||
GPtrArray *list;
|
||||
int i;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
list = g_ptr_array_new_with_free_func (
|
||||
ipv6 ? (GDestroyNotify) g_value_array_free : (GDestroyNotify) g_array_unref);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
|
||||
for (i = -1; i < 1000; i++) {
|
||||
const char **key_basename;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue