mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-02 03:46:39 +02:00
To switch GLib to have private-by-default symbols, we need to have a macro which expands to G_PUBLIC_API only when compiling a particular "sublibrary" in GLib (e.g. gmodule, gio). This patch implements that with a two-level scheme. First, each sublibrary has its own preprocessor macro e.g. _GTHREAD_API. Then, the Makefiles are modified to define this to G_PUBLIC_API only when building that library - so when building libgthread, _GMODULE_API is left undefined. Now, we could simply add _G*_API to every entry point, but because we've already been annotating all the headers with GLIB_AVAILABLE_IN_XX, let's modify those macros to automatically depend on a new "_G_API". Then the Makefiles further define _G_API to the target such as _GTHREAD_API. This indirection avoids a (glib version)*(sublibrary) explosion of preprocessor definitions in gversionmacros.h. https://bugzilla.gnome.org/show_bug.cgi?id=688681