Patch dbus-binding-tool

Matt Hoosier mwhoosier at gmail.com
Sat Aug 26 11:52:42 PDT 2006


What about the following version that would adjust to the language
under which it's compiled?

WRITE_OR_LOSE ("#ifdef __cplusplus\n");
WRITE_OR_LOSE ("  DBusGASyncData *data = static_cast<DBusGAsyncData*>
(user_data);\n");
WRITE_OR_LOSE ("#else\n");
WRITE_OR_LOSE ("  DBusGAsyncData *data = (DBusGASyncData *) user_data;\n");
WRITE_OR_LOSE ("#endif\n");
WRITE_OR_LOSE ("  GError *error = NULL;\n");

On 8/24/06, Jeroen T. Vermeulen <jtv at xs4all.nl> wrote:
> On Thu, August 24, 2006 21:03, keith preston wrote:
>
> > I didn't know that this style of casting was obsolete.  My basic problem
> > is
> > that the file that the binding tools generated can not be included in a
> > c++
> > file because the code it generates is not c++ compliant.   This can be
> > fixed
> > in two way.   Either add the cast to make the code compile under c++ or
> > have
> > the binding tools generate two files.  A .c file that contains the code
> > and
> > a .h file that just include the prototypes and can be included in a c++
> > file.
>
> AFAICS the time to rely on backwards compabitility between C++ and C is
> pretty much past...  Although in g++ at least you can get away with some
> C-isms in functions and declarations that are extern "C".
>
>
> Jeroen
>
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>


More information about the dbus mailing list