Re: Extension modules in C++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dne Čt 26. července 2012 14:02:56 Adrien Kunysz napsal(a):
> On Thu, Jul 26, 2012 at 10:57 AM, Petr Tesarik <ptesarik@xxxxxxx> wrote:
> > Hi all,
> > 
> > as part of SUSE HackWeek8, David started work on a GUI extension using
> > Qt4, which is a C++ project. One of the early annoyances is that an
> > extension module must include the declarations from defs.h, and we
> > currently use some C identifiers which happen to be keywords in C++,
> > namely:
> > 
> > - struct namespace
> > - struct namespace namespace (in struct symbol_table_data)
> > - char *typename (in struct gnu_request)
> > 
> > Can I rename them? But you said earlier that the existing API must never
> > change... Any other suggestions to make this include file parseable by a
> > C++ compiler?
> 
> One hack you could consider would be to do something like this:
> 
> extern "C" {
>         #define namespace ns
>         #include "defs.h"
>         #undef namespace
> }

Yes! That works, although I'm not entirely sure it can't do any harm. After 
all, it's what you called it - a hack. ;-)

I wonder whether Dave (Anderson) can suggest a cleaner solution (or make an 
official statement that he doesn't care about C++ compatibility).

Petr Tesarik
SUSE Linux

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility



[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux