kristoff <[email protected]> wrote: > Hi Matthew, > > > On 15-02-17 01:02, Matthew Lai wrote: > > Hi Kristoff, > > > > That syntax is called designated initializers, and is only legal in C. > > It's one of the few things that are legal in C (C99) and not C++. > > I would recommend compiling the file as C, and the rest of your > > application as C++. Though you'd want to make sure that the header has > > conditional compilation for C++ that adds 'extern "C" {...}' to avoid > > name mangling. > > After a good night sleep, I also came to the same conclussion. > > Thanks! :-) > > > I never had to mix C and C++ before so I'm still strugling a > bit but I'm getting there. > > > > Now, on a more general note, I do would like to make the case > to make sure libopencm3 is (re)writen in a C++ compatible > format.
In general I'm all for it, but designated initializers are bloody awesome and C++ is lame for not having them. You'll run into it in all the rcc clocks as well I'm afraid.
signature.html
Description: OpenPGP Digital Signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________ libopencm3-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libopencm3-devel
