Bug 6358

Summary: dbus glib bindings fail with c++
Product: dbus Reporter: Don Scorgie <Don>
Component: GLibAssignee: Rob Taylor <rob.taylor>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: chpe
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: A simple program that demonstrates the problem
fix

Description Don Scorgie 2006-03-23 05:58:01 UTC
I feel like I'm doing something stupid, but can't see what it is.  Apologies if
it is stupid.

When compiling a simple test program (which I'll attach in a minute) using g++,
a whole slew of errors are the result:

/opt/gnome2/include/dbus-1.0/dbus/dbus-glib-bindings.h: In function ‘void
org_freedesktop_DBus_Introspectable_introspect_async_callback(DBusGProxy*,
DBusGProxyCall*, void*)’:
/opt/gnome2/include/dbus-1.0/dbus/dbus-glib-bindings.h:28: error: invalid
conversion from ‘void*’ to ‘DBusGAsyncData*’
/opt/gnome2/include/dbus-1.0/dbus/dbus-glib-bindings.h: In function ‘void
org_freedesktop_DBus_request_name_async_callback(DBusGProxy*, DBusGProxyCall*,
void*)’:
/opt/gnome2/include/dbus-1.0/dbus/dbus-glib-bindings.h:71: error: invalid
conversion from ‘void*’ to ‘DBusGAsyncData*’
/opt/gnome2/include/dbus-1.0/dbus/dbus-glib-bindings.h: In function ‘void
org_freedesktop_DBus_release_name_async_callback(DBusGProxy*, DBusGProxyCall*,
void*)’
...
This continues for a 15 errors.  The same program as a C program works as expected.
Comment 1 Don Scorgie 2006-03-23 05:59:59 UTC
Created attachment 5024 [details]
A simple program that demonstrates the problem

Save file as silly.cpp
compile with
g++ -o silly silly.cpp `pkg-config --cflags --libs dbus-glib-1`
Watch errors appear

Rename silly.cpp to silly.c and  recompile with:
gcc-o silly silly.c `pkg-config --cflags --libs dbus-glib-1`
watch it compile cleanly.
Comment 2 Christian Persch (GNOME) 2006-10-12 07:19:23 UTC
Created attachment 7380 [details] [review]
fix

This fixes dbus-binding-tool to generate C++ compatible bindings.
Comment 3 Rob Taylor 2007-02-08 17:50:26 UTC
Fixed in git head.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.