non extern "C" callbacks
@murrayc
Submitted by Murray Cumming Link to original bug (#164852)
Description
glibmm has several callback functions that we give to glib, where they are defined as extern "C" functions, but most of ours are not extern "C". The SUN Forte compiler warns about this and the Tru64 compiler calls it an error when using its "strict_ansi" option. This might get more important in future.
Unfortunately, most of these callbacks are static member functions, which can not be extern "C". Changing them to separate functions means declaring them as friend functions [1] to the class, and, because of the need to declare functions before declaring them as friends, we often have to expose these functions as public API, without the help of a private: or protected: keyword.
[1]: Though we could put these functions into an anonymous namespace, to prevent them being exported as public API, we then have to way to refer to that namespace in the "friend void some_function(int)" friend declaration.
The attached patch fixes some of this, as described, but it is not pretty.
Version: 2.6.x