modules: Fix build on Visual Studio
authorChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 4 Jun 2020 08:27:56 +0000 (16:27 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 5 Jun 2020 03:16:45 +0000 (11:16 +0800)
commitacd9c12667a021936b30e0fa8f43d3a8c7133cf7
tree99689df4c66c1e10700d8b856ab0e2a7347ae287
parent5535b26395bb824fa594f608d734266dc52a38ff
modules: Fix build on Visual Studio

Visual Studio does not allow decorating functions with '__declspec (dllexport)'
if a prototype exists and is not decorated with '__declspec (dllexport)' as
well, so we cannot just decorate g_io_module_[load|unload|query] in the various
module sources with G_MODULE_EXPORT because the prototypes of these functions
have been marked with _GLIB_EXTERN, which equates to 'extern' unless overridden

Fix this by overriding _GLIB_EXTERN with the appropriate visibility flag, as we
have used to define _GDK_EXTERN.  Unfortunately, we can't just use _GDK_EXTERN
G_MODULE_EXPORT as they may have not been defined yet for our use

Do this across the board for all modules, even if they are not buildable on
Visual Studio nor Windows, for consistency's sake.
meson.build
modules/media/gtkgstmediafile.c
modules/media/meson.build
modules/printbackends/gtkprintbackendcloudprint.c
modules/printbackends/gtkprintbackendcups.c
modules/printbackends/gtkprintbackendfile.c
modules/printbackends/gtkprintbackendlpr.c
modules/printbackends/meson.build