Add glib__private__() API to share between glib,gio; port GWakeup to it
authorColin Walters <walters@verbum.org>
Thu, 1 Sep 2011 18:32:11 +0000 (14:32 -0400)
committerRyan Lortie <desrt@desrt.ca>
Fri, 9 Sep 2011 18:17:08 +0000 (14:17 -0400)
commit9bf59d4a14b3fc4bb62f10c3665e99f9d8788bdc
tree7bf00d864a2d00b5aff73ffadb9260cea7c0f136
parentb891b3616fa1c2af542cd188c00e074295bad4fe
Add glib__private__() API to share between glib,gio; port GWakeup to it

Historically we've added random symbols to the public API with warnings
that they're private; examples are:

glib_gettext(), glib_pgettext()
g_thread_functions_for_glib_use, g_thread_use_default_impl, etc.

And we almost added "GWakeup" to public API just to share between glib and
gio.

This new glib__private__() API exports a hidden vtable, and adds a macro
GLIB_PRIVATE_CALL() that makes it generally convenient to use.

This adds an extremely tiny cost for the double indirection; but it has
the benefit that we don't need to either:

1) compile the code into both glib and gio (like GWakeup), with the
   inefficiency that implies.
2) Export a "do not use this" symbol; the serious problem with this is
   that someone CAN use it pretty easily.  Particularly if we document
   it.  It's far, far harder to peek into a structure without a public
   header file.

https://bugzilla.gnome.org/show_bug.cgi?id=657992
gio/Makefile.am
gio/gcancellable.c
glib/Makefile.am
glib/glib-private.c [new file with mode: 0644]
glib/glib-private.h [new file with mode: 0644]
glib/glib.symbols