[Patch 1/1] Fix Clang compilation of BlueZ

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When trying to compile as much as I can in Gentoo with CLang, I realized
that Bluez is not compiling due to a function definition inside a
function, which is not allowed by clang.

I am not sure if this may be the best solution, but I've made a patch
that makes it compile without errors (not sure if it runs good yet though).

I hope it is useful for reviewing and applying if you consider necesary,

Thanks,


David C. Manuelda

diff --git a/profiles/midi/midi.c b/profiles/midi/midi.c
index 1ee5cb16f..8414e900f 100644
--- a/profiles/midi/midi.c
+++ b/profiles/midi/midi.c
@@ -71,20 +71,20 @@ struct midi {
 	struct midi_write_parser midi_out;
 };
 
+void foreach_cb(const struct midi_write_parser *parser, void *user_data) {
+	struct midi *midi = user_data;
+	bt_gatt_client_write_without_response(midi->client,
+	                                      midi->midi_io_handle,
+	                                      false,
+	                                      midi_write_data(parser),
+	                                      midi_write_data_size(parser));
+}
+
 static bool midi_write_cb(struct io *io, void *user_data)
 {
 	struct midi *midi = user_data;
 	int err;
 
-	void foreach_cb(const struct midi_write_parser *parser, void *user_data) {
-		struct midi *midi = user_data;
-		bt_gatt_client_write_without_response(midi->client,
-		                                      midi->midi_io_handle,
-		                                      false,
-		                                      midi_write_data(parser),
-		                                      midi_write_data_size(parser));
-	};
-
 	do {
 		snd_seq_event_t *event = NULL;
 

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux