After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754245 - common/dconf-changeset.h etc. lack extern "C" wrapper for C++
common/dconf-changeset.h etc. lack extern "C" wrapper for C++
Status: RESOLVED OBSOLETE
Product: dconf
Classification: Core
Component: dconf
git master
Other Linux
: Normal normal
: ---
Assigned To: dconf-maint
dconf-maint
Depends on:
Blocks:
 
 
Reported: 2015-08-28 15:03 UTC by Stephan Bergmann
Modified: 2018-09-21 16:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix (1.87 KB, patch)
2016-01-06 14:04 UTC, Stephan Bergmann
none Details | Review

Description Stephan Bergmann 2015-08-28 15:03:11 UTC
Somewhat unexpectedly, common/dconf-changeset.h etc. (as included from dconf/dconf.h) lack the usual

  #ifdef __cplusplus
  extern "C" {
  #endif
  ...

wrappers, so naively doing

  #include <dconf/dconf.h>
  ...
  dconf_changeset_new();

in C++ code will lead to linker errors about an undefined reference to a (mangled name) dconf_changeset_new C++ function.

This is apparently not a problem for the functions decleared in dconf-client.h, presumably because G_BEGIN/END_DECLS covers those extern "C" wrappers for C++.
Comment 1 Matthias Clasen 2015-08-31 16:33:02 UTC
Indeed, G_BEGIN/END_DECLS is just that: extern "C" { }
Comment 2 Matthias Clasen 2015-08-31 18:26:29 UTC
I'm sure a patch that wraps all the installed headers in extern "C" { } would be welcome
Comment 3 Stephan Bergmann 2016-01-06 14:04:48 UTC
Created attachment 318323 [details] [review]
fix
Comment 4 GNOME Infrastructure Team 2018-09-21 16:15:18 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/dconf/issues/23.