diff --git a/Makefile.am b/Makefile.am
index a63c469..eec458e 100644
--- a/Makefile.am
+++ b/Makefile.am
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 \
diff --git a/attrib/client.c b/attrib/client.c
index 70cbf15..bfe5877 100644
--- a/attrib/client.c
+++ b/attrib/client.c
#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"
diff --git a/attrib/gatt.c b/attrib/gatt.c
index a62f348..452a4cf 100644
--- a/attrib/gatt.c
+++ b/attrib/gatt.c
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
-#include "glib-helper.h"
+#include "glib-compat.h"
#include "att.h"
#include "gattrib.h"
diff --git a/audio/a2dp.c b/audio/a2dp.c
index 47be7fd..75ad6ce 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
#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"
diff --git a/audio/avdtp.c b/audio/avdtp.c
index 5b24f38..d3568ba 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
#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"
diff --git a/audio/gateway.c b/audio/gateway.c
index 1a1c035..fb16a3d 100644
--- a/audio/gateway.c
+++ b/audio/gateway.c
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
+#include "glib-compat.h"
#include "glib-helper.h"
#include "device.h"
#include "gateway.h"
diff --git a/audio/headset.c b/audio/headset.c
index f1cda6a..e45e216 100644
--- a/audio/headset.c
+++ b/audio/headset.c
#include "error.h"
#include "telephony.h"
#include "headset.h"
+#include "glib-compat.h"
#include "glib-helper.h"
#include "btio.h"
#include "dbus-common.h"
diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
index fb59013..5df3235 100644
--- a/audio/telephony-maemo6.c
+++ b/audio/telephony-maemo6.c
#include <bluetooth/sdp.h>
-#include "glib-helper.h"
+#include "glib-compat.h"
#include "log.h"
#include "telephony.h"
#include "error.h"
diff --git a/audio/telephony-ofono.c b/audio/telephony-ofono.c
index 26815cf..3607d7f 100644
--- a/audio/telephony-ofono.c
+++ b/audio/telephony-ofono.c
#include <bluetooth/sdp.h>
-#include "glib-helper.h"
+#include "glib-compat.h"
#include "log.h"
#include "telephony.h"
diff --git a/audio/unix.c b/audio/unix.c
index c2d6d4a..4e0a6f9 100644
--- a/audio/unix.c
+++ b/audio/unix.c
#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')
diff --git a/network/connection.c b/network/connection.c
index ac27cf2..ca1f4b2 100644
--- a/network/connection.c
+++ b/network/connection.c
#include <gdbus.h>
#include "log.h"
-#include "glib-helper.h"
+#include "glib-compat.h"
#include "btio.h"
#include "dbus-common.h"
#include "adapter.h"
diff --git a/network/server.c b/network/server.c
index 7865f39..6e0ce09 100644
--- a/network/server.c
+++ b/network/server.c
#include "error.h"
#include "sdpd.h"
#include "btio.h"
-#include "glib-helper.h"
+#include "glib-compat.h"
#include "common.h"
#include "server.h"
diff --git a/plugins/hciops.c b/plugins/hciops.c
index 8d97f97..90b2112 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
#include <glib.h>
-#include "glib-helper.h"
+#include "glib-compat.h"
#include "hcid.h"
#include "sdpd.h"
#include "btio.h"
diff --git a/serial/port.c b/serial/port.c
index 7f5fce1..045f459 100644
--- a/serial/port.c
+++ b/serial/port.c
#include "../src/dbus-common.h"
#include "log.h"
+#include "glib-compat.h"
#include "glib-helper.h"
#include "btio.h"
diff --git a/src/adapter.c b/src/adapter.c
index d1ef17c..c2999d1 100644
--- a/src/adapter.c
+++ b/src/adapter.c
#include "device.h"
#include "dbus-common.h"
#include "error.h"
+#include "glib-compat.h"
#include "glib-helper.h"
#include "agent.h"
#include "storage.h"
diff --git a/src/attrib-server.c b/src/attrib-server.c
index 9ba5f74..e412061 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
#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"
diff --git a/src/device.c b/src/device.c
index b7e343b..339c001 100644
--- a/src/device.c
+++ b/src/device.c
#include "device.h"
#include "dbus-common.h"
#include "error.h"
+#include "glib-compat.h"
#include "glib-helper.h"
#include "gatt.h"
#include "agent.h"
diff --git a/src/eir.c b/src/eir.c
index 8772191..e82d30b 100644
--- a/src/eir.c
+++ b/src/eir.c
#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
index 0000000..d50d5e9
--- /dev/null
+++ b/src/glib-compat.h
+/*
+ *
+ * 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
diff --git a/src/glib-helper.c b/src/glib-helper.c
index 0288c9c..bb8883e 100644
--- a/src/glib-helper.c
+++ b/src/glib-helper.c
#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 */
diff --git a/src/glib-helper.h b/src/glib-helper.h
index a383741..c83f5e2 100644
--- a/src/glib-helper.h
+++ b/src/glib-helper.h
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/storage.c b/src/storage.c
index c64842c..cc0213b 100644
--- a/src/storage.c
+++ b/src/storage.c
#include <bluetooth/sdp_lib.h>
#include "textfile.h"
+#include "glib-compat.h"
#include "glib-helper.h"
#include "storage.h"