diff options
author | Thomas Haller <thaller@redhat.com> | 2014-10-29 10:07:25 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-10-31 21:14:50 +0100 |
commit | 78b8db8417fdd8fa23c2b2e2a792ac0e4ceb429d (patch) | |
tree | 8e4a8f948154abde7025a3de5a0b799d62e46570 | |
parent | a45b73606264ae1eb98ce6ec9c951f6c43509981 (diff) | |
parent | a6bfa1b87c962a0db2e4a0fc00ff508570d1c7e0 (diff) | |
download | network-manager-applet-78b8db8417fdd8fa23c2b2e2a792ac0e4ceb429d.tar.gz |
all: merge branch 'th/bgo739246_clang' (bgo #739246)
Fixes for compilation with clang and several issues that surfaced
due to new complier warnings.
https://bugzilla.gnome.org/show_bug.cgi?id=739246
Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit b75fc2c67503a5f76036f96033f29f74ab5e62a9)
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | m4/compiler_warnings.m4 | 30 | ||||
-rw-r--r-- | src/ap-menu-item.c | 2 | ||||
-rw-r--r-- | src/applet-device-cdma.c | 2 | ||||
-rw-r--r-- | src/applet-device-gsm.c | 2 | ||||
-rw-r--r-- | src/applet-vpn-request.h | 2 | ||||
-rw-r--r-- | src/applet.c | 2 | ||||
-rw-r--r-- | src/connection-editor/ip4-routes-dialog.c | 2 | ||||
-rw-r--r-- | src/connection-editor/ip6-routes-dialog.c | 2 | ||||
-rw-r--r-- | src/connection-editor/page-dcb.c | 4 | ||||
-rw-r--r-- | src/connection-editor/page-ip4.c | 2 | ||||
-rw-r--r-- | src/connection-editor/page-ip6.c | 2 | ||||
-rw-r--r-- | src/connection-editor/page-mobile.c | 1 | ||||
-rw-r--r-- | src/gconf-helpers/gconf-helpers.c | 154 | ||||
-rw-r--r-- | src/gconf-helpers/gconf-helpers.h | 17 | ||||
-rw-r--r-- | src/gconf-helpers/gconf-upgrade.c | 6 | ||||
-rw-r--r-- | src/gnome-bluetooth/nma-bt-device.c | 37 | ||||
-rw-r--r-- | src/utils/Makefile.am | 2 | ||||
-rw-r--r-- | src/utils/nm-glib-compat.h (renamed from src/utils/nm-gvaluearray-compat.h) | 33 |
19 files changed, 87 insertions, 216 deletions
@@ -10,6 +10,7 @@ configure compile config.* aclocal.m4 +/cscope.files depcomp install-sh libtool diff --git a/m4/compiler_warnings.m4 b/m4/compiler_warnings.m4 index 95ad3fbe..578dc595 100644 --- a/m4/compiler_warnings.m4 +++ b/m4/compiler_warnings.m4 @@ -7,24 +7,48 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then AC_MSG_RESULT(yes) CFLAGS="-Wall -std=gnu89 $CFLAGS" + dnl clang only warns about unknown warnings, unless + dnl called with "-Werror=unknown-warning-option" + dnl Test if the compiler supports that, and if it does + dnl attach it to the CFLAGS. + SAVE_CFLAGS="$CFLAGS" + EXTRA_CFLAGS="-Werror=unknown-warning-option" + CFLAGS="$SAVE_CFLAGS $EXTRA_CFLAGS" + AC_TRY_COMPILE([], [], + has_option=yes, + has_option=no,) + if test $has_option = no; then + EXTRA_CFLAGS= + fi + CFLAGS="$SAVE_CFLAGS" + unset has_option + unset SAVE_CFLAGS + for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \ - -Wdeclaration-after-statement -Wstrict-prototypes \ + -Wdeclaration-after-statement -Wformat-security \ + -Wstrict-prototypes \ -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \ - -fno-strict-aliasing -Wno-unused-but-set-variable; do + -fno-strict-aliasing -Wno-unused-but-set-variable \ + -Wundef -Wimplicit-function-declaration \ + -Wpointer-arith -Winit-self \ + -Wmissing-include-dirs -Waggregate-return; do SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $option" + CFLAGS="$CFLAGS $EXTRA_CFLAGS $option" AC_MSG_CHECKING([whether gcc understands $option]) AC_TRY_COMPILE([], [], has_option=yes, has_option=no,) if test $has_option = no; then CFLAGS="$SAVE_CFLAGS" + else + CFLAGS="$SAVE_CFLAGS $option" fi AC_MSG_RESULT($has_option) unset has_option unset SAVE_CFLAGS done unset option + unset EXTRA_CFLAGS if test "x$set_more_warnings" = xerror; then CFLAGS="$CFLAGS -Werror" fi diff --git a/src/ap-menu-item.c b/src/ap-menu-item.c index ad60d6b6..b345a1c2 100644 --- a/src/ap-menu-item.c +++ b/src/ap-menu-item.c @@ -185,7 +185,7 @@ nm_network_menu_item_best_strength (NMNetworkMenuItem * item, g_object_unref (pixbuf); } -const const char * +const char * nm_network_menu_item_get_hash (NMNetworkMenuItem * item) { g_return_val_if_fail (item != NULL, NULL); diff --git a/src/applet-device-cdma.c b/src/applet-device-cdma.c index 1640d479..995bfcde 100644 --- a/src/applet-device-cdma.c +++ b/src/applet-device-cdma.c @@ -44,7 +44,7 @@ #include "nm-mobile-providers.h" #include "mb-menu-item.h" #include "nm-ui-utils.h" -#include "nm-gvaluearray-compat.h" +#include "nm-glib-compat.h" typedef struct { NMApplet *applet; diff --git a/src/applet-device-gsm.c b/src/applet-device-gsm.c index ca5ad530..fd5e9dc7 100644 --- a/src/applet-device-gsm.c +++ b/src/applet-device-gsm.c @@ -49,7 +49,7 @@ #include "nma-marshal.h" #include "nm-mobile-providers.h" #include "nm-ui-utils.h" -#include "nm-gvaluearray-compat.h" +#include "nm-glib-compat.h" typedef enum { MM_MODEM_GSM_ACCESS_TECH_UNKNOWN = 0, diff --git a/src/applet-vpn-request.h b/src/applet-vpn-request.h index 835daebf..2fe5d283 100644 --- a/src/applet-vpn-request.h +++ b/src/applet-vpn-request.h @@ -20,7 +20,7 @@ * (C) Copyright 2004 - 2011 Red Hat, Inc. */ -#ifndef APPLET_VPN_REQEUST_H +#ifndef APPLET_VPN_REQUEST_H #define APPLET_VPN_REQUEST_H #include "applet.h" diff --git a/src/applet.c b/src/applet.c index 48b5f663..5011b31e 100644 --- a/src/applet.c +++ b/src/applet.c @@ -2924,7 +2924,7 @@ applet_update_icon (gpointer user_data) GdkPixbuf *pixbuf = NULL; NMState state; char *dev_tip = NULL, *vpn_tip = NULL; - NMVPNConnectionState vpn_state = NM_VPN_SERVICE_STATE_UNKNOWN; + NMVPNConnectionState vpn_state = NM_VPN_CONNECTION_STATE_UNKNOWN; gboolean nm_running; NMActiveConnection *active_vpn = NULL; diff --git a/src/connection-editor/ip4-routes-dialog.c b/src/connection-editor/ip4-routes-dialog.c index 494a357f..95c11079 100644 --- a/src/connection-editor/ip4-routes-dialog.c +++ b/src/connection-editor/ip4-routes-dialog.c @@ -455,7 +455,7 @@ cell_changed_cb (GtkEditable *editable, colorname = value_valid ? "lightgreen" : "red"; gdk_rgba_parse (&rgba, colorname); - gtk_widget_override_background_color (GTK_WIDGET (editable), GTK_STATE_NORMAL, &rgba); + gtk_widget_override_background_color (GTK_WIDGET (editable), GTK_STATE_FLAG_NORMAL, &rgba); g_free (cell_text); return FALSE; diff --git a/src/connection-editor/ip6-routes-dialog.c b/src/connection-editor/ip6-routes-dialog.c index 74a71293..c1fef559 100644 --- a/src/connection-editor/ip6-routes-dialog.c +++ b/src/connection-editor/ip6-routes-dialog.c @@ -396,7 +396,7 @@ cell_changed_cb (GtkEditable *editable, colorname = value_valid ? "lightgreen" : "red"; gdk_rgba_parse (&rgba, colorname); - gtk_widget_override_background_color (GTK_WIDGET (editable), GTK_STATE_NORMAL, &rgba); + gtk_widget_override_background_color (GTK_WIDGET (editable), GTK_STATE_FLAG_NORMAL, &rgba); g_free (cell_text); return FALSE; diff --git a/src/connection-editor/page-dcb.c b/src/connection-editor/page-dcb.c index d50e95d0..8b3026d8 100644 --- a/src/connection-editor/page-dcb.c +++ b/src/connection-editor/page-dcb.c @@ -125,10 +125,10 @@ uint_entries_validate (GtkBuilder *builder, const char *fmt, gint max, gboolean if (errno || num < 0 || num > max) { /* FIXME: only sets highlight color? */ gdk_rgba_parse (&bgcolor, "red3"); - gtk_widget_override_background_color (GTK_WIDGET (entry), GTK_STATE_NORMAL, &bgcolor); + gtk_widget_override_background_color (GTK_WIDGET (entry), GTK_STATE_FLAG_NORMAL, &bgcolor); valid = FALSE; } else - gtk_widget_override_background_color (GTK_WIDGET (entry), GTK_STATE_NORMAL, NULL); + gtk_widget_override_background_color (GTK_WIDGET (entry), GTK_STATE_FLAG_NORMAL, NULL); total += (guint) num; } diff --git a/src/connection-editor/page-ip4.c b/src/connection-editor/page-ip4.c index e35e8ac9..83b80447 100644 --- a/src/connection-editor/page-ip4.c +++ b/src/connection-editor/page-ip4.c @@ -727,7 +727,7 @@ cell_changed_cb (GtkEditable *editable, colorname = value_valid ? "lightgreen" : "red"; gdk_rgba_parse (&rgba, colorname); - gtk_widget_override_background_color (GTK_WIDGET (editable), GTK_STATE_NORMAL, &rgba); + gtk_widget_override_background_color (GTK_WIDGET (editable), GTK_STATE_FLAG_NORMAL, &rgba); g_free (cell_text); return FALSE; diff --git a/src/connection-editor/page-ip6.c b/src/connection-editor/page-ip6.c index 7dfea809..35a68195 100644 --- a/src/connection-editor/page-ip6.c +++ b/src/connection-editor/page-ip6.c @@ -722,7 +722,7 @@ cell_changed_cb (GtkEditable *editable, colorname = value_valid ? "lightgreen" : "red"; gdk_rgba_parse (&rgba, colorname); - gtk_widget_override_background_color (GTK_WIDGET (editable), GTK_STATE_NORMAL, &rgba); + gtk_widget_override_background_color (GTK_WIDGET (editable), GTK_STATE_FLAG_NORMAL, &rgba); g_free (cell_text); return FALSE; diff --git a/src/connection-editor/page-mobile.c b/src/connection-editor/page-mobile.c index 57424260..a7415082 100644 --- a/src/connection-editor/page-mobile.c +++ b/src/connection-editor/page-mobile.c @@ -27,6 +27,7 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> +#include <nm-glib-compat.h> #include <nm-setting-connection.h> #include <nm-setting-gsm.h> #include <nm-setting-cdma.h> diff --git a/src/gconf-helpers/gconf-helpers.c b/src/gconf-helpers/gconf-helpers.c index 53014be6..14ed13b8 100644 --- a/src/gconf-helpers/gconf-helpers.c +++ b/src/gconf-helpers/gconf-helpers.c @@ -53,7 +53,7 @@ #include "gconf-helpers.h" #include "gconf-upgrade.h" -#include "nm-gvaluearray-compat.h" +#include "nm-glib-compat.h" #define S390_OPT_KEY_PREFIX "s390-opt-" @@ -503,90 +503,6 @@ out: return success; } -#if UNUSED -static void -property_value_destroy (gpointer data) -{ - GValue *value = (GValue *) data; - - g_value_unset (value); - g_slice_free (GValue, data); -} - - -static void -add_property (GHashTable *properties, const char *key, GConfValue *gconf_value) -{ - GValue *value = NULL; - - if (!gconf_value) - return; - - switch (gconf_value->type) { - case GCONF_VALUE_STRING: - value = g_slice_new0 (GValue); - g_value_init (value, G_TYPE_STRING); - g_value_set_string (value, gconf_value_get_string (gconf_value)); - break; - case GCONF_VALUE_INT: - value = g_slice_new0 (GValue); - g_value_init (value, G_TYPE_INT); - g_value_set_int (value, gconf_value_get_int (gconf_value)); - break; - case GCONF_VALUE_BOOL: - value = g_slice_new0 (GValue); - g_value_init (value, G_TYPE_BOOLEAN); - g_value_set_boolean (value, gconf_value_get_bool (gconf_value)); - break; - default: - break; - } - - if (value) - g_hash_table_insert (properties, gconf_unescape_key (key, -1), value); -} - -gboolean -nm_gconf_get_valuehash_helper (GConfClient *client, - const char *path, - const char *setting, - GHashTable **value) -{ - char *gc_key; - GSList *gconf_entries; - GSList *iter; - int prefix_len; - - g_return_val_if_fail (setting != NULL, FALSE); - g_return_val_if_fail (value != NULL, FALSE); - - gc_key = g_strdup_printf ("%s/%s", path, setting); - prefix_len = strlen (gc_key); - gconf_entries = gconf_client_all_entries (client, gc_key, NULL); - g_free (gc_key); - - if (!gconf_entries) - return FALSE; - - *value = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, - property_value_destroy); - - for (iter = gconf_entries; iter; iter = iter->next) { - GConfEntry *entry = (GConfEntry *) iter->data; - - gc_key = (char *) gconf_entry_get_key (entry); - gc_key += prefix_len + 1; /* get rid of the full path */ - - add_property (*value, gc_key, gconf_entry_get_value (entry)); - gconf_entry_unref (entry); - } - - g_slist_free (gconf_entries); - return TRUE; -} -#endif - gboolean nm_gconf_get_stringhash_helper (GConfClient *client, const char *path, @@ -1252,59 +1168,6 @@ typedef struct { char *path; } WritePropertiesInfo; -#if UNUSED -static void -write_properties_valuehash (gpointer key, gpointer val, gpointer user_data) -{ - GValue *value = (GValue *) val; - WritePropertiesInfo *info = (WritePropertiesInfo *) user_data; - char *esc_key; - char *full_key; - - esc_key = gconf_escape_key ((char *) key, -1); - full_key = g_strconcat (info->path, "/", esc_key, NULL); - g_free (esc_key); - - if (G_VALUE_HOLDS_STRING (value)) - gconf_client_set_string (info->client, full_key, g_value_get_string (value), NULL); - else if (G_VALUE_HOLDS_INT (value)) - gconf_client_set_int (info->client, full_key, g_value_get_int (value), NULL); - else if (G_VALUE_HOLDS_BOOLEAN (value)) - gconf_client_set_bool (info->client, full_key, g_value_get_boolean (value), NULL); - else - g_warning ("Don't know how to write '%s' to gconf", G_VALUE_TYPE_NAME (value)); - - g_free (full_key); -} - -gboolean -nm_gconf_set_valuehash_helper (GConfClient *client, - const char *path, - const char *setting, - GHashTable *value) -{ - char *gc_key; - WritePropertiesInfo info; - - g_return_val_if_fail (setting != NULL, FALSE); - g_return_val_if_fail (value != NULL, FALSE); - - gc_key = g_strdup_printf ("%s/%s", path, setting); - if (!gc_key) { - g_warning ("Not enough memory to create gconf path"); - return FALSE; - } - - info.client = client; - info.path = gc_key; - - g_hash_table_foreach (value, write_properties_valuehash, &info); - - g_free (gc_key); - return TRUE; -} -#endif - gboolean nm_gconf_set_stringhash_helper (GConfClient *client, const char *path, @@ -1956,15 +1819,6 @@ read_one_setting_value_from_gconf (NMSetting *setting, g_slist_foreach (sa_val, (GFunc) g_free, NULL); g_slist_free (sa_val); } -#if UNUSED - } else if (type == DBUS_TYPE_G_MAP_OF_VARIANT) { - GHashTable *vh_val = NULL; - - if (nm_gconf_get_valuehash_helper (info->client, info->dir, setting_name, &vh_val)) { - g_object_set (setting, key, vh_val, NULL); - g_hash_table_destroy (vh_val); - } -#endif } else if (type == DBUS_TYPE_G_MAP_OF_STRING) { GHashTable *sh_val = NULL; @@ -2697,12 +2551,6 @@ copy_one_setting_value_to_gconf (NMSetting *setting, nm_gconf_set_stringlist_helper (info->client, info->dir, key, setting_name, (GSList *) g_value_get_boxed (value)); -#if UNUSED - } else if (type == DBUS_TYPE_G_MAP_OF_VARIANT) { - nm_gconf_set_valuehash_helper (info->client, info->dir, - setting_name, - (GHashTable *) g_value_get_boxed (value)); -#endif } else if (type == DBUS_TYPE_G_MAP_OF_STRING) { nm_gconf_set_stringhash_helper (info->client, info->dir, key, setting_name, diff --git a/src/gconf-helpers/gconf-helpers.h b/src/gconf-helpers/gconf-helpers.h index 2a1aca0c..7088366a 100644 --- a/src/gconf-helpers/gconf-helpers.h +++ b/src/gconf-helpers/gconf-helpers.h @@ -91,15 +91,6 @@ nm_gconf_get_uint_array_helper (GConfClient *client, const char *setting, GArray **value); - -#if UNUSED -gboolean -nm_gconf_get_valuehash_helper (GConfClient *client, - const char *path, - const char *setting, - GHashTable **value); -#endif - gboolean nm_gconf_get_stringhash_helper (GConfClient *client, const char *path, @@ -194,14 +185,6 @@ nm_gconf_set_uint_array_helper (GConfClient *client, const char *setting, GArray *value); -#if UNUSED -gboolean -nm_gconf_set_valuehash_helper (GConfClient *client, - const char *path, - const char *setting, - GHashTable *value); -#endif - gboolean nm_gconf_set_stringhash_helper (GConfClient *client, const char *path, diff --git a/src/gconf-helpers/gconf-upgrade.c b/src/gconf-helpers/gconf-upgrade.c index f332bdbf..cbda095c 100644 --- a/src/gconf-helpers/gconf-upgrade.c +++ b/src/gconf-helpers/gconf-upgrade.c @@ -253,12 +253,6 @@ nm_gconf_read_0_6_wep_settings (GConfClient *client, return s_wireless_sec; } -static const struct flagnames wpa_versions[] = { - { "wpa", IW_AUTH_WPA_VERSION_WPA }, - { "rsn", IW_AUTH_WPA_VERSION_WPA2 }, - { NULL, 0 } -}; - static NMSettingWirelessSecurity * nm_gconf_read_0_6_wpa_settings (GConfClient *client, const char *path, diff --git a/src/gnome-bluetooth/nma-bt-device.c b/src/gnome-bluetooth/nma-bt-device.c index 3a33dcef..870d2be1 100644 --- a/src/gnome-bluetooth/nma-bt-device.c +++ b/src/gnome-bluetooth/nma-bt-device.c @@ -493,15 +493,10 @@ wizard_done_cb (NMAMobileWizard *wizard, static void start_wizard (NmaBtDevice *self, const gchar *path, - NMDeviceType devtype) + NMDeviceModemCapabilities caps) { NmaBtDevicePrivate *priv = NMA_BT_DEVICE_GET_PRIVATE (self); - if (devtype == NM_DEVICE_TYPE_UNKNOWN) { - dun_error (self, __func__, NULL, _("unknown modem type.")); - return; - } - if (priv->wizard) { g_message ("%s: (%s) oops! not starting Wizard as one is already in progress", __func__, path); return; @@ -515,7 +510,7 @@ start_wizard (NmaBtDevice *self, /* Start the mobile wizard */ priv->wizard = nma_mobile_wizard_new (priv->parent_window, priv->window_group, - devtype, + caps, FALSE, wizard_done_cb, self); @@ -531,7 +526,7 @@ modem_get_all_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) GHashTable *properties = NULL; GError *error = NULL; GValue *value; - NMDeviceType devtype = NM_DEVICE_TYPE_UNKNOWN; + NMDeviceModemCapabilities caps = NM_DEVICE_MODEM_CAPABILITY_NONE; path = dbus_g_proxy_get_path (proxy); g_message ("%s: (%s) processing GetAll reply", __func__, path); @@ -561,10 +556,10 @@ modem_get_all_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) if (value && G_VALUE_HOLDS_UINT (value)) { switch (g_value_get_uint (value)) { case 1: - devtype = NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS; + caps = NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS; break; case 2: - devtype = NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO; + caps = NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO; break; default: g_message ("%s: (%s) unknown modem type", __func__, path); @@ -583,7 +578,7 @@ modem_get_all_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) g_hash_table_unref (properties); /* Launch wizard! */ - start_wizard (self, path, devtype); + start_wizard (self, path, caps); out: g_message ("%s: finished", __func__); @@ -646,12 +641,12 @@ check_modem (NmaBtDevice *self, MMObject *modem_object) { NmaBtDevicePrivate *priv = NMA_BT_DEVICE_GET_PRIVATE (self); - NMDeviceType devtype = NM_DEVICE_TYPE_UNKNOWN; + NMDeviceModemCapabilities caps = NM_DEVICE_MODEM_CAPABILITY_NONE; MMModem *modem_iface; const gchar *path; const gchar *primary_port; const gchar *iface_basename; - MMModemCapability caps; + MMModemCapability mm_caps; path = mm_object_get_path (modem_object); g_message ("%s: (%s) modem found", __func__, path); @@ -675,21 +670,21 @@ check_modem (NmaBtDevice *self, } /* This is the modem we were waiting for, so keep on */ - caps = mm_modem_get_current_capabilities (modem_iface); + mm_caps = mm_modem_get_current_capabilities (modem_iface); /* CDMA-only? */ - if (caps == MM_MODEM_CAPABILITY_CDMA_EVDO) - devtype = NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO; + if (mm_caps == MM_MODEM_CAPABILITY_CDMA_EVDO) + caps = NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO; /* GSM/UMTS-only? */ - else if (caps == MM_MODEM_CAPABILITY_GSM_UMTS) - devtype = NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS; + else if (mm_caps == MM_MODEM_CAPABILITY_GSM_UMTS) + caps = NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS; /* LTE? */ - else if (caps & MM_MODEM_CAPABILITY_LTE) - devtype = NM_DEVICE_MODEM_CAPABILITY_LTE; + else if (mm_caps & MM_MODEM_CAPABILITY_LTE) + caps = NM_DEVICE_MODEM_CAPABILITY_LTE; else g_message ("%s: (%s) unknown modem type", __func__, path); /* Launch wizard! */ - start_wizard (self, path, devtype); + start_wizard (self, path, caps); return TRUE; } diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 24299277..8c56353e 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -3,7 +3,7 @@ SUBDIRS=. tests noinst_LTLIBRARIES = libutils.la libutils_la_SOURCES = \ - nm-gvaluearray-compat.h \ + nm-glib-compat.h \ utils.c \ utils.h diff --git a/src/utils/nm-gvaluearray-compat.h b/src/utils/nm-glib-compat.h index 35d6b867..d88d0ffd 100644 --- a/src/utils/nm-gvaluearray-compat.h +++ b/src/utils/nm-glib-compat.h @@ -15,14 +15,36 @@ * 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. + * Copyright 2013-2014 Red Hat, Inc. */ -#ifndef NM_GVALUEARRAY_COMPAT_H -#define NM_GVALUEARRAY_COMPAT_H +#ifndef NM_GLIB_COMPAT_H +#define NM_GLIB_COMPAT_H #include <glib.h> + +/*************************************************************/ + +#ifdef __clang__ + +#undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS +#undef G_GNUC_END_IGNORE_DEPRECATIONS + +#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") + +#define G_GNUC_END_IGNORE_DEPRECATIONS \ + _Pragma("clang diagnostic pop") + +#endif + + +/************************************************************* + * undeprecate GValueArray + *************************************************************/ + #define g_value_array_get_type() \ G_GNUC_EXTENSION ({ \ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ @@ -100,4 +122,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS \ }) -#endif /* NM_GVALUEARRAY_COMPAT_H */ +/*************************************************************/ + + +#endif /* NM_GLIB_COMPAT_H */ |