OSDN Git Service

Add glib-compat.h to deal with issues in old GLib versions
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 18 Oct 2011 07:57:06 +0000 (10:57 +0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Tue, 18 Oct 2011 07:57:06 +0000 (10:57 +0300)
22 files changed:
Makefile.am
attrib/client.c
attrib/gatt.c
audio/a2dp.c
audio/avdtp.c
audio/gateway.c
audio/headset.c
audio/telephony-maemo6.c
audio/telephony-ofono.c
audio/unix.c
network/connection.c
network/server.c
plugins/hciops.c
serial/port.c
src/adapter.c
src/attrib-server.c
src/device.c
src/eir.c
src/glib-compat.h [new file with mode: 0644]
src/glib-helper.c
src/glib-helper.h
src/storage.c

index a63c469..eec458e 100644 (file)
@@ -301,7 +301,7 @@ src_bluetoothd_SOURCES = $(gdbus_sources) $(builtin_sources) \
                        src/sdpd-service.c src/sdpd-database.c \
                        src/attrib-server.h src/attrib-server.c \
                        src/sdp-xml.h src/sdp-xml.c \
-                       src/textfile.h src/textfile.c \
+                       src/textfile.h src/textfile.c src/glib-compat.h \
                        src/glib-helper.h src/glib-helper.c \
                        src/oui.h src/oui.c src/uinput.h src/ppoll.h \
                        src/plugin.h src/plugin.c \
index 70cbf15..bfe5877 100644 (file)
@@ -36,7 +36,7 @@
 #include <bluetooth/sdp_lib.h>
 #include <bluetooth/uuid.h>
 
-#include "glib-helper.h"
+#include "glib-compat.h"
 #include "adapter.h"
 #include "device.h"
 #include "log.h"
index a62f348..452a4cf 100644 (file)
@@ -33,7 +33,7 @@
 #include <bluetooth/sdp.h>
 #include <bluetooth/sdp_lib.h>
 
-#include "glib-helper.h"
+#include "glib-compat.h"
 
 #include "att.h"
 #include "gattrib.h"
index 47be7fd..75ad6ce 100644 (file)
@@ -36,7 +36,7 @@
 #include <bluetooth/sdp.h>
 #include <bluetooth/sdp_lib.h>
 
-#include "glib-helper.h"
+#include "glib-compat.h"
 #include "log.h"
 #include "device.h"
 #include "manager.h"
index 5b24f38..d3568ba 100644 (file)
@@ -52,7 +52,7 @@
 #include "manager.h"
 #include "control.h"
 #include "avdtp.h"
-#include "glib-helper.h"
+#include "glib-compat.h"
 #include "btio.h"
 #include "sink.h"
 #include "source.h"
index 1a1c035..fb16a3d 100644 (file)
@@ -42,6 +42,7 @@
 #include <bluetooth/sdp.h>
 #include <bluetooth/sdp_lib.h>
 
+#include "glib-compat.h"
 #include "glib-helper.h"
 #include "device.h"
 #include "gateway.h"
index f1cda6a..e45e216 100644 (file)
@@ -53,6 +53,7 @@
 #include "error.h"
 #include "telephony.h"
 #include "headset.h"
+#include "glib-compat.h"
 #include "glib-helper.h"
 #include "btio.h"
 #include "dbus-common.h"
index fb59013..5df3235 100644 (file)
@@ -38,7 +38,7 @@
 
 #include <bluetooth/sdp.h>
 
-#include "glib-helper.h"
+#include "glib-compat.h"
 #include "log.h"
 #include "telephony.h"
 #include "error.h"
index 26815cf..3607d7f 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <bluetooth/sdp.h>
 
-#include "glib-helper.h"
+#include "glib-compat.h"
 #include "log.h"
 #include "telephony.h"
 
index c2d6d4a..4e0a6f9 100644 (file)
@@ -52,7 +52,7 @@
 #include "source.h"
 #include "gateway.h"
 #include "unix.h"
-#include "glib-helper.h"
+#include "glib-compat.h"
 
 #define check_nul(str) (str[sizeof(str) - 1] == '\0')
 
index ac27cf2..ca1f4b2 100644 (file)
@@ -38,7 +38,7 @@
 #include <gdbus.h>
 
 #include "log.h"
-#include "glib-helper.h"
+#include "glib-compat.h"
 #include "btio.h"
 #include "dbus-common.h"
 #include "adapter.h"
index 7865f39..6e0ce09 100644 (file)
@@ -46,7 +46,7 @@
 #include "error.h"
 #include "sdpd.h"
 #include "btio.h"
-#include "glib-helper.h"
+#include "glib-compat.h"
 
 #include "common.h"
 #include "server.h"
index 8d97f97..90b2112 100644 (file)
@@ -40,7 +40,7 @@
 
 #include <glib.h>
 
-#include "glib-helper.h"
+#include "glib-compat.h"
 #include "hcid.h"
 #include "sdpd.h"
 #include "btio.h"
index 7f5fce1..045f459 100644 (file)
@@ -48,6 +48,7 @@
 #include "../src/dbus-common.h"
 
 #include "log.h"
+#include "glib-compat.h"
 #include "glib-helper.h"
 #include "btio.h"
 
index d1ef17c..c2999d1 100644 (file)
@@ -52,6 +52,7 @@
 #include "device.h"
 #include "dbus-common.h"
 #include "error.h"
+#include "glib-compat.h"
 #include "glib-helper.h"
 #include "agent.h"
 #include "storage.h"
index 9ba5f74..e412061 100644 (file)
@@ -38,7 +38,7 @@
 #include <bluetooth/sdp_lib.h>
 
 #include "log.h"
-#include "glib-helper.h"
+#include "glib-compat.h"
 #include "btio.h"
 #include "sdpd.h"
 #include "hcid.h"
index b7e343b..339c001 100644 (file)
@@ -54,6 +54,7 @@
 #include "device.h"
 #include "dbus-common.h"
 #include "error.h"
+#include "glib-compat.h"
 #include "glib-helper.h"
 #include "gatt.h"
 #include "agent.h"
index 8772191..e82d30b 100644 (file)
--- a/src/eir.c
+++ b/src/eir.c
@@ -35,6 +35,7 @@
 #include <bluetooth/hci.h>
 #include <bluetooth/sdp.h>
 
+#include "glib-compat.h"
 #include "glib-helper.h"
 #include "eir.h"
 
diff --git a/src/glib-compat.h b/src/glib-compat.h
new file mode 100644 (file)
index 0000000..d50d5e9
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2004-2011  Marcel Holtmann <marcel@holtmann.org>
+ *
+ *
+ *  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 St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef NEED_G_SLIST_FREE_FULL
+static inline void g_slist_free_full(GSList *list, GDestroyNotify free_func)
+{
+       g_slist_foreach(list, (GFunc) free_func, NULL);
+       g_slist_free(list);
+}
+#endif
index 0288c9c..bb8883e 100644 (file)
@@ -39,6 +39,7 @@
 
 #include "btio.h"
 #include "sdpd.h"
+#include "glib-compat.h"
 #include "glib-helper.h"
 
 /* Number of seconds to keep a sdp_session_t in the cache */
index a383741..c83f5e2 100644 (file)
@@ -34,11 +34,3 @@ char *bt_name2string(const char *string);
 int bt_string2uuid(uuid_t *uuid, const char *string);
 gchar *bt_list2string(GSList *list);
 GSList *bt_string2list(const gchar *str);
-
-#ifdef NEED_G_SLIST_FREE_FULL
-static inline void g_slist_free_full(GSList *list, GDestroyNotify free_func)
-{
-       g_slist_foreach(list, (GFunc) free_func, NULL);
-       g_slist_free(list);
-}
-#endif
index c64842c..cc0213b 100644 (file)
@@ -43,6 +43,7 @@
 #include <bluetooth/sdp_lib.h>
 
 #include "textfile.h"
+#include "glib-compat.h"
 #include "glib-helper.h"
 #include "storage.h"