Dolphin, the GameCube and Wii emulator - Forums
Linux WiiMote (bluetooth) support - Printable Version

+- Dolphin, the GameCube and Wii emulator - Forums (https://forums.dolphin-emu.org)
+-- Forum: Dolphin Emulator Discussion and Support (https://forums.dolphin-emu.org/Forum-dolphin-emulator-discussion-and-support)
+--- Forum: Development Discussion (https://forums.dolphin-emu.org/Forum-development-discussion)
+--- Thread: Linux WiiMote (bluetooth) support (/Thread-linux-wiimote-bluetooth-support)



Linux WiiMote (bluetooth) support - maggu2810 - 03-04-2012

If the WiiMote support is build, the file <bluetooth/bluetooth.h> is also included, e.g. because of the bt_get_... functions.
The file comes from the Bluez library.
Recent versions break C++ support (casting void* to anything). So the most distributions are using the following patch to allow usage with C++ code:
http://www.spinics.net/lists/linux-bluetooth/msg20995.html

Because you are using the C++x0 standard, the keyword "typeof" is not available but __typeof__ is (for gcc).
Until Bluez is changing something, the following patch allows compilation again:

diff -Naur a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt 2012-03-03 17:17:50.303444767 +0000
+++ b/CMakeLists.txt 2012-03-03 17:17:03.688443435 +0000
@@ -553,6 +553,7 @@
# Start compiling our code
#
add_definitions(-std=c++0x)
+add_definitions(-Dtypeof=__typeof__)
add_subdirectory(Source)


I also reported the typeof issue to the Bluez mailing list:
http://permalink.gmane.org/gmane.linux.bluez.kernel/22294


RE: Linux WiiMote (bluetooth) support - scummos - 03-04-2012

You can also use CMAKE_CXX_FLAGS=-fpermissive, alternatively. This does not even require changing the file, just run "cmake .. -DCMAKE_CXX_FLAGS=-fpermissive". Smile

But yeah, the issue is definitely there. Still, the complaint goes into the direction of the bluez developers Smile


RE: Linux WiiMote (bluetooth) support - maggu2810 - 03-04-2012

Thanks for the "fpermissive hint."

One can argue about who has to change something.
The developers of Bluez could also state that, whoever wishes to use its library has to meet some criteria... Confused
But ATM the C++ support / patch is not available upstream.

A hope a solution can be found.