Linux bluetooth development
 help / color / mirror / Atom feed
From: StormByte <stormbyte@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [Patch 1/1] Fix Clang compilation of BlueZ
Date: Tue, 7 Aug 2018 13:34:20 +0200	[thread overview]
Message-ID: <ef6beb0a-e40d-8b3a-9ebb-0d0489f2ca00@gmail.com> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 445 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: fix-clang-build.patch --]
[-- Type: text/x-patch; name="fix-clang-build.patch", Size: 1242 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2018-08-07 11:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 11:34 StormByte [this message]
2018-08-07 12:57 ` [Patch 1/1] Fix Clang compilation of BlueZ Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef6beb0a-e40d-8b3a-9ebb-0d0489f2ca00@gmail.com \
    --to=stormbyte@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox