Linux bluetooth development
 help / color / mirror / Atom feed
* [Patch 1/1] Fix Clang compilation of BlueZ
@ 2018-08-07 11:34 StormByte
  2018-08-07 12:57 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 2+ messages in thread
From: StormByte @ 2018-08-07 11:34 UTC (permalink / raw)
  To: linux-bluetooth


[-- 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 --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch 1/1] Fix Clang compilation of BlueZ
  2018-08-07 11:34 [Patch 1/1] Fix Clang compilation of BlueZ StormByte
@ 2018-08-07 12:57 ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2018-08-07 12:57 UTC (permalink / raw)
  To: StormByte; +Cc: linux-bluetooth@vger.kernel.org

Hi,

On Tue, Aug 7, 2018 at 2:34 PM, StormByte <stormbyte@gmail.com> wrote:
> 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,

Apparently this one passed the review, but we normally don't allow
such construction, anyway do you mind sending a proper patch as stated
in HACKING?

> Thanks,
>
>
> David C. Manuelda
>



-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-07 12:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-07 11:34 [Patch 1/1] Fix Clang compilation of BlueZ StormByte
2018-08-07 12:57 ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox