[network-manager-applet] build: avoid GValueArray deprecation warnings
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet] build: avoid GValueArray deprecation warnings
- Date: Tue, 12 Mar 2013 19:23:51 +0000 (UTC)
commit ef18ed015aca7edb689ff8c80618cae8ae5cc445
Author: Dan Winship <danw gnome org>
Date: Sun Feb 24 15:11:48 2013 +0100
build: avoid GValueArray deprecation warnings
Copy in nm-gvaluearray-compat.h from NM, and use it as needed
src/applet-device-cdma.c | 1 +
src/applet-device-gsm.c | 1 +
src/gconf-helpers/gconf-helpers.c | 1 +
src/utils/Makefile.am | 1 +
src/utils/nm-gvaluearray-compat.h | 103 +++++++++++++++++++++++++++++++++++++
5 files changed, 107 insertions(+), 0 deletions(-)
---
diff --git a/src/applet-device-cdma.c b/src/applet-device-cdma.c
index 91f71f6..f45ad33 100644
--- a/src/applet-device-cdma.c
+++ b/src/applet-device-cdma.c
@@ -44,6 +44,7 @@
#include "nm-mobile-providers.h"
#include "mb-menu-item.h"
#include "nm-ui-utils.h"
+#include "nm-gvaluearray-compat.h"
typedef struct {
NMApplet *applet;
diff --git a/src/applet-device-gsm.c b/src/applet-device-gsm.c
index 4575f39..2bf1ae4 100644
--- a/src/applet-device-gsm.c
+++ b/src/applet-device-gsm.c
@@ -49,6 +49,7 @@
#include "nma-marshal.h"
#include "nm-mobile-providers.h"
#include "nm-ui-utils.h"
+#include "nm-gvaluearray-compat.h"
typedef enum {
MM_MODEM_GSM_ACCESS_TECH_UNKNOWN = 0,
diff --git a/src/gconf-helpers/gconf-helpers.c b/src/gconf-helpers/gconf-helpers.c
index c244671..92a6de9 100644
--- a/src/gconf-helpers/gconf-helpers.c
+++ b/src/gconf-helpers/gconf-helpers.c
@@ -53,6 +53,7 @@
#include "gconf-helpers.h"
#include "gconf-upgrade.h"
+#include "nm-gvaluearray-compat.h"
#if !GLIB_CHECK_VERSION(2,31,0)
#define g_value_set_schar g_value_set_char
diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am
index 1a3308c..2429927 100644
--- a/src/utils/Makefile.am
+++ b/src/utils/Makefile.am
@@ -3,6 +3,7 @@ SUBDIRS=. tests
noinst_LTLIBRARIES = libutils.la
libutils_la_SOURCES = \
+ nm-gvaluearray-compat.h \
utils.c \
utils.h
diff --git a/src/utils/nm-gvaluearray-compat.h b/src/utils/nm-gvaluearray-compat.h
new file mode 100644
index 0000000..35d6b86
--- /dev/null
+++ b/src/utils/nm-gvaluearray-compat.h
@@ -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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]