Skip to contentSkip to conversation

Fix compilation with clang

PATCH New David Carlos Manuelda 1 participant 2 messages Aug 7, 2018 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

cover Fix compilation with clang

ISO C forbids nested functions, which gcc implemented as extension

David Carlos Manuelda (1):
build: Clang fix - ISO C forbids nested functions

 profiles/midi/midi.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/1 build: Clang fix - ISO C forbids nested functions

---
 profiles/midi/midi.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
profiles/midi/midi.c +9 -9
index 1ee5cb16f..f08728e4b 100644
@@ -71,20 +71,20 @@ struct midi {
 	struct midi_write_parser midi_out;
 };
 
+static 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;
 
Signature · 1 line
2.18.0