From 4edab14e738fdca5c749e92429216763fc49efa0 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 12 Nov 2014 17:06:35 +0100 Subject: [PATCH] bluez: Another bluez5 build fix Fixes the "unused declaration" warning with -Werror and no bluez-libs. Fixes: f1c9595311f52d8b79e8d2032e006005613a8fb1 Fixes: 751b52e50be049b53a0b998638a22d4e28a59135 --- src/devices/bluetooth/nm-bluez-device.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/devices/bluetooth/nm-bluez-device.c b/src/devices/bluetooth/nm-bluez-device.c index a941685b9..6e80708d8 100644 --- a/src/devices/bluetooth/nm-bluez-device.c +++ b/src/devices/bluetooth/nm-bluez-device.c @@ -30,9 +30,12 @@ #include "nm-bluez-device.h" #include "nm-logging.h" #include "nm-settings-connection.h" -#include "nm-bluez5-dun.h" #include "NetworkManagerUtils.h" +#if WITH_BLUEZ5_DUN +#include "nm-bluez5-dun.h" +#endif + G_DEFINE_TYPE (NMBluezDevice, nm_bluez_device, G_TYPE_OBJECT) #define NM_BLUEZ_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_BLUEZ_DEVICE, NMBluezDevicePrivate)) @@ -59,7 +62,9 @@ typedef struct { gboolean connected; char *b4_iface; +#if WITH_BLUEZ5_DUN NMBluez5DunContext *b5_dun_context; +#endif NMConnectionProvider *provider; GSList *connections; @@ -495,6 +500,7 @@ bluez_connect_cb (GDBusConnection *dbus_connection, g_object_unref (result_object); } +#if WITH_BLUEZ5_DUN static void bluez5_dun_connect_cb (NMBluez5DunContext *context, const char *device, @@ -514,6 +520,7 @@ bluez5_dun_connect_cb (NMBluez5DunContext *context, g_simple_async_result_complete (result); g_object_unref (result); } +#endif void nm_bluez_device_connect_async (NMBluezDevice *self, @@ -1097,14 +1104,12 @@ dispose (GObject *object) priv->pan_connection = NULL; } - if (priv->b5_dun_context) { #if WITH_BLUEZ5_DUN + if (priv->b5_dun_context) { nm_bluez5_dun_free (priv->b5_dun_context); -#else - g_assert_not_reached (); -#endif priv->b5_dun_context = NULL; } +#endif g_signal_handlers_disconnect_by_func (priv->provider, cp_connection_added, self); g_signal_handlers_disconnect_by_func (priv->provider, cp_connection_removed, self);