diff options
author | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2023-03-31 15:24:13 +0200 |
---|---|---|
committer | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2023-03-31 15:24:13 +0200 |
commit | 98f3b67b5c1bd71d0e7b41193fb4683fc957e321 (patch) | |
tree | 1fa8a4cf1bf9a93a79bfe08be83426bb15da01e9 /glib/glibmm/main.h | |
parent | b7ad9b86d70003c065606c563578cc66dcd2ce0a (diff) | |
download | glibmm-2-76.tar.gz |
Glib: Use callback functions with C linkageglibmm-2-76
* gio/src/cancellable.ccg: Add TODO comment.
* glib/glibmm/class.cc: Call custom_class_base_finalize_function() and
custom_class_init_function() via local functions with C linkage.
* glib/glibmm/extraclassinit.h: Point out in the class documentation that
the class init and instance init functions shall have C linkage.
* glib/glibmm/main.[cc|h]: Call prepare_vfunc(), check_vfunc() and
dispatch_vfunc() via local functions with C linkage.
* glib/glibmm/objectbase.cc: Call destroy_notify_callback()
via a local function with C linkage.
* glib/glibmm/propertyproxy_base.cc: Call PropertyProxyConnectionNode::
callback() and destroy_notify_handler() via local functions with C linkage.
* glib/glibmm/signalproxy.cc: Call SignalProxyNormal::slot0_void_callback()
and SignalProxyConnectionNode::destroy_notify_handler() via local functions
with C linkage.
* glib/src/binding.ccg: Add extern "C".
* glib/src/bytearray.ccg: Add a TODO comment.
* glib/src/markup.ccg: Call functions in the vfunc table via local
functions with C linkage.
* glib/src/optioncontext.ccg: Add extern "C".
* glib/src/optiongroup.ccg: Call post_parse_callback() and
option_arg_callback() via local functions with C linkage.
Part of issue #1
Diffstat (limited to 'glib/glibmm/main.h')
-rw-r--r-- | glib/glibmm/main.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/glib/glibmm/main.h b/glib/glibmm/main.h index ecdfb9a7..77c27909 100644 --- a/glib/glibmm/main.h +++ b/glib/glibmm/main.h @@ -494,6 +494,8 @@ public: * This function could possibly be used to integrate the GLib event loop with an external event * loop. * @param poll_func The function to call to poll all file descriptors. + * This function shall have C linkage. (Many compilers also accept + * a function with C++ linkage.) */ void set_poll_func(GPollFunc poll_func); @@ -800,9 +802,11 @@ protected: /** Wrap an existing GSource object and install the given callback function. * The constructed object doesn't use the virtual functions prepare(), check() and dispatch(). * This constructor is for use by derived types that need to wrap a GSource object. - * The callback function can be a static member function. But beware - - * depending on the actual implementation of the GSource's virtual functions - * the expected type of the callback function can differ from GSourceFunc. + * The callback function is called from GLib (a C library). It shall have C + * linkage. (Many compilers accept a function with C++ linkage. If you use + * only such compilers, the callback function can be a static member function.) + * But beware - depending on the actual implementation of the GSource's virtual + * functions the expected type of the callback function can differ from GSourceFunc. */ GLIBMM_API Source(GSource* cast_item, GSourceFunc callback_func); @@ -927,6 +931,9 @@ protected: /** Wrap an existing GSource object and install the given callback function. * This constructor is for use by derived types that need to wrap a GSource object. + * The callback function is called from GLib (a C library). It shall have C + * linkage. (Many compilers accept a function with C++ linkage. If you use + * only such compilers, the callback function can be a static member function.) * @see Source::Source(GSource*, GSourceFunc). * @newin{2,42} */ |