From 159740e7dc59df562c5752820e1f44ceccb2c1e3 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 7 Mar 2012 11:02:34 +0100 Subject: [PATCH] Update patches --- 0001-Add-sixaxis-cable-pairing-plugin.patch | 36 ++++----- bluez.spec | 3 - cplusplus_void_cast.patch | 82 --------------------- 3 files changed, 18 insertions(+), 103 deletions(-) delete mode 100644 cplusplus_void_cast.patch diff --git a/0001-Add-sixaxis-cable-pairing-plugin.patch b/0001-Add-sixaxis-cable-pairing-plugin.patch index c4ad775..498d23f 100644 --- a/0001-Add-sixaxis-cable-pairing-plugin.patch +++ b/0001-Add-sixaxis-cable-pairing-plugin.patch @@ -1,4 +1,4 @@ -From 3e999539978919395af19ac1b554ca997ab1b3d1 Mon Sep 17 00:00:00 2001 +From 2977a39aad96cb3f2be90c6291169a25c9965fc9 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 30 Dec 2011 12:34:29 +0100 Subject: [PATCH] Add sixaxis cable-pairing plugin @@ -19,7 +19,7 @@ address, and added to the database of the current default adapter. create mode 100644 plugins/cable.c diff --git a/Makefile.am b/Makefile.am -index 102ee62..63d7198 100644 +index cafb4cc..4ccf4f0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -244,6 +244,11 @@ builtin_sources += thermometer/main.c \ @@ -43,7 +43,7 @@ index 102ee62..63d7198 100644 src_bluetoothd_LDFLAGS = -Wl,--export-dynamic \ -Wl,--version-script=$(srcdir)/src/bluetooth.ver -@@ -432,7 +437,7 @@ EXTRA_DIST += doc/manager-api.txt \ +@@ -447,7 +452,7 @@ EXTRA_DIST += doc/manager-api.txt \ AM_YFLAGS = -d @@ -53,10 +53,10 @@ index 102ee62..63d7198 100644 INCLUDES = -I$(builddir)/lib -I$(builddir)/src -I$(srcdir)/src \ -I$(srcdir)/audio -I$(srcdir)/sbc -I$(srcdir)/gdbus \ diff --git a/acinclude.m4 b/acinclude.m4 -index 57fc5e0..90582ba 100644 +index b0f790c..20a930c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 -@@ -149,6 +149,12 @@ AC_DEFUN([AC_PATH_UDEV], [ +@@ -152,6 +152,12 @@ AC_DEFUN([AC_PATH_UDEV], [ AC_SUBST(UDEV_LIBS) ]) @@ -69,7 +69,7 @@ index 57fc5e0..90582ba 100644 AC_DEFUN([AC_PATH_SNDFILE], [ PKG_CHECK_MODULES(SNDFILE, sndfile, sndfile_found=yes, sndfile_found=no) AC_SUBST(SNDFILE_CFLAGS) -@@ -186,6 +192,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [ +@@ -189,6 +195,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [ sndfile_enable=${sndfile_found} hal_enable=no usb_enable=${usb_found} @@ -77,7 +77,7 @@ index 57fc5e0..90582ba 100644 alsa_enable=${alsa_found} gstreamer_enable=${gstreamer_found} audio_enable=yes -@@ -296,6 +303,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [ +@@ -298,6 +305,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [ usb_enable=${enableval} ]) @@ -85,10 +85,10 @@ index 57fc5e0..90582ba 100644 + cable_enable=${enableval} + ]) + - AC_ARG_ENABLE(tracer, AC_HELP_STRING([--enable-tracer], [install Tracing daemon]), [ - tracer_enable=${enableval} + AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools], [install Bluetooth utilities]), [ + tools_enable=${enableval} ]) -@@ -395,6 +406,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [ +@@ -393,6 +404,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [ AC_DEFINE(HAVE_LIBUSB, 1, [Define to 1 if you have USB library.]) fi @@ -99,14 +99,14 @@ index 57fc5e0..90582ba 100644 AM_CONDITIONAL(SNDFILE, test "${sndfile_enable}" = "yes" && test "${sndfile_found}" = "yes") AM_CONDITIONAL(USB, test "${usb_enable}" = "yes" && test "${usb_found}" = "yes") AM_CONDITIONAL(SBC, test "${alsa_enable}" = "yes" || test "${gstreamer_enable}" = "yes" || -@@ -432,4 +447,5 @@ AC_DEFUN([AC_ARG_BLUEZ], [ +@@ -429,4 +444,5 @@ AC_DEFUN([AC_ARG_BLUEZ], [ AM_CONDITIONAL(DBUSOOBPLUGIN, test "${dbusoob_enable}" = "yes") AM_CONDITIONAL(WIIMOTEPLUGIN, test "${wiimote_enable}" = "yes") AM_CONDITIONAL(THERMOMETERPLUGIN, test "${thermometer_enable}" = "yes") + AM_CONDITIONAL(CABLE, test "${cable_enable}" = "yes" && test "${cable_found}" = "yes") ]) diff --git a/configure.ac b/configure.ac -index 5b81f28..0e0dd9d 100644 +index cd0f1cf..c61f230 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,7 @@ AC_PATH_GSTREAMER @@ -119,7 +119,7 @@ index 5b81f28..0e0dd9d 100644 AC_PATH_CHECK diff --git a/plugins/cable.c b/plugins/cable.c new file mode 100644 -index 0000000..e8cff76 +index 0000000..b974b4c --- /dev/null +++ b/plugins/cable.c @@ -0,0 +1,382 @@ @@ -506,10 +506,10 @@ index 0000000..e8cff76 +BLUETOOTH_PLUGIN_DEFINE(cable, VERSION, + BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, cable_init, cable_exit) diff --git a/src/adapter.c b/src/adapter.c -index 7e4bbb6..012f632 100644 +index acb845e..478a8fb 100644 --- a/src/adapter.c +++ b/src/adapter.c -@@ -1014,6 +1014,25 @@ static struct btd_device *adapter_create_device(DBusConnection *conn, +@@ -952,6 +952,25 @@ static struct btd_device *adapter_create_device(DBusConnection *conn, return device; } @@ -536,10 +536,10 @@ index 7e4bbb6..012f632 100644 struct btd_device *device, gboolean remove_storage) diff --git a/src/adapter.h b/src/adapter.h -index fb1dcdf..4c3d148 100644 +index ceebb97..b0a0461 100644 --- a/src/adapter.h +++ b/src/adapter.h -@@ -108,6 +108,9 @@ void adapter_update_found_devices(struct btd_adapter *adapter, +@@ -123,6 +123,9 @@ void adapter_update_found_devices(struct btd_adapter *adapter, uint8_t *data, uint8_t data_len); void adapter_emit_device_found(struct btd_adapter *adapter, struct remote_dev_info *dev); @@ -550,5 +550,5 @@ index fb1dcdf..4c3d148 100644 int adapter_set_name(struct btd_adapter *adapter, const char *name); void adapter_name_changed(struct btd_adapter *adapter, const char *name); -- -1.7.6.4 +1.7.7.6 diff --git a/bluez.spec b/bluez.spec index af4cedc..4c67c3a 100644 --- a/bluez.spec +++ b/bluez.spec @@ -22,8 +22,6 @@ Patch5: 0001-Add-sixaxis-cable-pairing-plugin.patch Patch6: 0001-systemd-install-systemd-unit-files.patch Patch7: sbc_mmx.patch -# Bug #791292 -Patch8: cplusplus_void_cast.patch BuildRequires: flex BuildRequires: dbus-devel >= 0.90 @@ -149,7 +147,6 @@ and mouse. %patch5 -p1 -b .cable-pairing %patch6 -p1 -b .systemd %patch7 -p1 -b .mmx -%patch8 -p1 -b .cplusplus %build libtoolize -f -c diff --git a/cplusplus_void_cast.patch b/cplusplus_void_cast.patch deleted file mode 100644 index df7d62f..0000000 --- a/cplusplus_void_cast.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 21c794102c27d8474809cb54578941f8bbe63218 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= -Date: Tue, 28 Feb 2012 11:22:11 +0100 -Subject: [PATCH] Fix compiling C++ applications -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The compiler error is: - /usr/include/bluetooth/bluetooth.h::131:9: error: invalid conversion from 'void*' to 'bt_get_le64(void*)::*' - ... - -The reason is that C++, in contrast to C, does not allow conversion of -void * to anything, and this code gets compiled as C++ when the app is -written in C++. The macro with the assignment itself is older, but only -recent Bluez starts to use it in inline functions, thus triggering the -problem. - -This patch keeps the "struct __attribute__((packed))" magic and merely -changes the typecast so that it works in C and C++. Like the existing -macro this patch relies on support for typeof. - -The new variant of the code is in an ifdef and only used for C++ -to avoid unexpected regressions in C applications. - -Signed-off-by: Patrick Ohly ---- - lib/bluetooth.h | 31 +++++++++++++++++++++++++++++++ - 1 files changed, 31 insertions(+), 0 deletions(-) - -diff --git a/lib/bluetooth.h b/lib/bluetooth.h -index 5bd4f03..3f1a177 100644 ---- a/lib/bluetooth.h -+++ b/lib/bluetooth.h -@@ -109,6 +109,12 @@ enum { - #endif - - /* Bluetooth unaligned access */ -+#ifndef __cplusplus -+/* -+ * traditional code, doesn't work in C++ because -+ * of the void * to struct pointer assignment -+ */ -+ - #define bt_get_unaligned(ptr) \ - ({ \ - struct __attribute__((packed)) { \ -@@ -125,6 +131,31 @@ do { \ - __p->__v = (val); \ - } while(0) - -+#else /* __cplusplus */ -+ -+/* -+ * modified code with typeof typecast, for C++; -+ * the traditional code continues to be used for -+ * C to avoid unexpected regressions with this -+ * code here (it should work in C and C++, though) -+ */ -+#define bt_get_unaligned(ptr) \ -+({ \ -+ struct __attribute__((packed)) { \ -+ typeof(*(ptr)) __v; \ -+ } *__p = (typeof(__p)) (ptr); \ -+ __p->__v; \ -+}) -+ -+#define bt_put_unaligned(val, ptr) \ -+do { \ -+ struct __attribute__((packed)) { \ -+ typeof(*(ptr)) __v; \ -+ } *__p = (typeof(__p)) (ptr); \ -+ __p->__v = (val); \ -+} while(0) -+#endif /* __cplusplus */ -+ - #if __BYTE_ORDER == __LITTLE_ENDIAN - static inline uint64_t bt_get_le64(void *ptr) - { --- -1.7.7.6 -