summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2011-07-04 11:09:55 +0200
committerMarcel Holtmann <marcel@holtmann.org>2011-07-04 11:09:55 +0200
commit3f553a30adf1b03afc00ab2a1a969ccd1d5037a9 (patch)
treeb5438ed3a92adfa02ac72e32d50b4b8bb1c92666
parenta128f02646b7e4d76eba6e61d2990505f97152ce (diff)
downloadbluez-3f553a30adf1b03afc00ab2a1a969ccd1d5037a9.tar.gz
Allow building with GLib 2.16 for now
-rw-r--r--acinclude.m47
-rw-r--r--attrib/client.c3
-rw-r--r--attrib/gatt.c6
-rw-r--r--audio/a2dp.c1
-rw-r--r--audio/media.c1
-rw-r--r--plugins/hciops.c1
-rw-r--r--src/eir.c5
-rw-r--r--src/glib-helper.h8
-rw-r--r--src/manager.c3
9 files changed, 33 insertions, 2 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 67ee1a407..af97cce5a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -106,8 +106,11 @@ AC_DEFUN([AC_PATH_DBUS], [
])
AC_DEFUN([AC_PATH_GLIB], [
- PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
- AC_MSG_ERROR(GLib library version 2.28 or later is required))
+ PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
+ AC_MSG_ERROR(GLib library version 2.16 or later is required))
+ AC_CHECK_LIB(glib-2.0, g_slist_free_full, dummy=yes,
+ AC_DEFINE(NEED_G_SLIST_FREE_FULL, 1,
+ [Define to 1 if you need g_slist_free_full() function.]))
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
])
diff --git a/attrib/client.c b/attrib/client.c
index c9629c403..1ef2699ec 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -32,8 +32,11 @@
#include <glib.h>
#include <bluetooth/bluetooth.h>
+#include <bluetooth/sdp.h>
+#include <bluetooth/sdp_lib.h>
#include <bluetooth/uuid.h>
+#include "glib-helper.h"
#include "adapter.h"
#include "device.h"
#include "log.h"
diff --git a/attrib/gatt.c b/attrib/gatt.c
index a27d1af93..77c96f377 100644
--- a/attrib/gatt.c
+++ b/attrib/gatt.c
@@ -22,6 +22,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdint.h>
#include <stdlib.h>
#include <glib.h>
@@ -29,6 +33,8 @@
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
+#include "glib-helper.h"
+
#include "att.h"
#include "gattrib.h"
#include "gatt.h"
diff --git a/audio/a2dp.c b/audio/a2dp.c
index 4fbd65147..bb065d451 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -36,6 +36,7 @@
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
+#include "glib-helper.h"
#include "log.h"
#include "device.h"
#include "manager.h"
diff --git a/audio/media.c b/audio/media.c
index a58e96f9b..3978a1727 100644
--- a/audio/media.c
+++ b/audio/media.c
@@ -34,6 +34,7 @@
#include "../src/adapter.h"
#include "../src/dbus-common.h"
+#include "glib-helper.h"
#include "log.h"
#include "error.h"
#include "device.h"
diff --git a/plugins/hciops.c b/plugins/hciops.c
index 92f976aeb..ecc0e8638 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
@@ -40,6 +40,7 @@
#include <glib.h>
+#include "glib-helper.h"
#include "hcid.h"
#include "sdpd.h"
#include "btio.h"
diff --git a/src/eir.c b/src/eir.c
index ac23064f2..d632fa815 100644
--- a/src/eir.c
+++ b/src/eir.c
@@ -21,6 +21,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <errno.h>
#include <stdlib.h>
#include <stdint.h>
diff --git a/src/glib-helper.h b/src/glib-helper.h
index c83f5e29a..a38374164 100644
--- a/src/glib-helper.h
+++ b/src/glib-helper.h
@@ -34,3 +34,11 @@ 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
diff --git a/src/manager.c b/src/manager.c
index dd8cb5056..e31f432ed 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -34,6 +34,8 @@
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
+#include <bluetooth/sdp.h>
+#include <bluetooth/sdp_lib.h>
#include <glib.h>
@@ -41,6 +43,7 @@
#include <gdbus.h>
+#include "glib-helper.h"
#include "hcid.h"
#include "dbus-common.h"
#include "log.h"