From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Patrick Ohly <patrick.ohly@intel.com>, linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] bluetooth.h: fix compile issue when using in C++
Date: Mon, 5 Mar 2012 17:06:18 -0300 [thread overview]
Message-ID: <CAMOw1v5mcoDbBo_yotfci6o+zak+9OjhTKUm134zj2YGHGVssQ@mail.gmail.com> (raw)
In-Reply-To: <1330903638.3392.141.camel@aeonflux>
On Sun, Mar 4, 2012 at 8:27 PM, Marcel Holtmann <marcel@holtmann.org> wrote=
:
> Hi Patrick,
>
>> The compiler error is:
>> =C2=A0/usr/include/bluetooth/bluetooth.h::131:9:=E2=80=82error:=E2=80=82=
invalid=E2=80=82conversion from=E2=80=82'void*'=E2=80=82to=E2=80=82'bt_get_=
le64(void*)::<anonymous=E2=80=82struct>*'
>> =C2=A0...
>>
>> The reason is that C++, in contrast to C, does not allow conversion of
>> void * to anything, and this code gets compiled as C++ when the app is
>> written in C++. The macro with the assignment itself is older, but only
>> recent Bluez starts to use it in inline functions, thus triggering the
>> problem.
>>
>> This patch keeps the "struct __attribute__((packed))" magic and merely
>> changes the typecast so that it works in C and C++. Like the existing
>> macro this patch relies on support for typeof.
>
> so I am applying this patch now, but I still have no idea what kind of
> stupid C++ compiler you are using. The section of this include is
> clearly marked as C code:
>
> #ifdef __cplusplus
> extern "C" {
> #endif
This only tells the compiler that this part has C linkage and not C++
Lucas De Marchi
next prev parent reply other threads:[~2012-03-05 20:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-16 10:11 [PATCH] bluetooth.h: fix compile issue when using in C++ Patrick Ohly
2012-03-04 23:27 ` Marcel Holtmann
2012-03-05 7:33 ` Patrick Ohly
[not found] ` <CAOcK=CNZofxZtUp4Zh5eiGMM_TYrbGOwseA3tcwAnAFDvLEFxg@mail.gmail.com>
2012-03-05 13:12 ` Patrick Ohly
2012-03-05 14:53 ` Markus Rathgeb
2012-07-27 16:38 ` W. Trevor King
2012-08-17 5:18 ` W. Trevor King
2012-08-27 23:40 ` Johan Hedberg
2012-09-05 17:27 ` Pacho Ramos
2012-09-05 17:56 ` Pacho Ramos
2012-03-05 20:06 ` Lucas De Marchi [this message]
2012-03-08 13:22 ` Markus Rathgeb
2012-03-08 17:51 ` Marcel Holtmann
2012-03-08 20:59 ` Markus Rathgeb
2012-03-09 10:52 ` Markus Rathgeb
-- strict thread matches above, loose matches on Subject: below --
2012-03-03 17:15 Markus Rathgeb
2012-07-29 7:52 Pacho Ramos
2012-08-01 14:41 ` Pacho Ramos
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=CAMOw1v5mcoDbBo_yotfci6o+zak+9OjhTKUm134zj2YGHGVssQ@mail.gmail.com \
--to=lucas.demarchi@profusion.mobi \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=patrick.ohly@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).