Revert "modules: Fix build on Visual Studio"

This reverts commit acd9c12667.

This commit breaks the build with GLib main on all platforms,
and defining _GLIB_EXTERN arguably invades the GLib namespace.

A different fix for msvc will have to be found.
This commit is contained in:
Matthias Clasen 2022-10-31 20:18:12 -04:00
parent 1a8ff606f2
commit 0a6f3944a0
7 changed files with 19 additions and 16 deletions

View File

@ -342,19 +342,15 @@ endif
common_cflags = cc.get_supported_arguments(test_cflags)
# Symbol visibility
if os_win32
visibility_define = '__declspec(dllexport) extern'
else
visibility_define = '__attribute__((visibility("default"))) extern'
endif
if get_option('default_library') != 'static'
cdata.set('_GDK_EXTERN', visibility_define)
if os_win32
cdata.set('DLL_EXPORT', true)
endif
if cc.get_id() != 'msvc'
cdata.set('_GDK_EXTERN', '__declspec(dllexport) extern')
if cc.get_id() != 'msvc'
common_cflags += ['-fvisibility=hidden']
endif
else
cdata.set('_GDK_EXTERN', '__attribute__((visibility("default"))) extern')
common_cflags += ['-fvisibility=hidden']
endif
endif

View File

@ -97,6 +97,7 @@ G_DEFINE_TYPE_EXTENDED (GtkGstMediaFile, gtk_gst_media_file, GTK_TYPE_MEDIA_FILE
G_IMPLEMENT_INTERFACE (GDK_TYPE_PAINTABLE,
gtk_gst_media_file_paintable_init))
G_MODULE_EXPORT
void
g_io_module_load (GIOModule *module)
{
@ -108,6 +109,7 @@ g_io_module_load (GIOModule *module)
10);
}
G_MODULE_EXPORT
G_GNUC_NORETURN
void
g_io_module_unload (GIOModule *module)
@ -115,6 +117,7 @@ g_io_module_unload (GIOModule *module)
g_assert_not_reached ();
}
G_MODULE_EXPORT
char **
g_io_module_query (void)
{

View File

@ -2,11 +2,7 @@ media_subdir = 'gtk-4.0/@0@/media'.format(gtk_binary_version)
media_install_dir = join_paths(get_option('libdir'), media_subdir)
media_backends = []
extra_c_args = [
'-DGTK_COMPILATION',
'-D_GLIB_EXTERN=@0@'.format(visibility_define),
]
extra_c_args = ['-DGTK_COMPILATION']
extra_c_args += common_cflags
ffmpeg_opt = get_option('media-ffmpeg')

View File

@ -246,6 +246,7 @@ static void secrets_service_vanished_cb (GDBusConnec
G_DEFINE_DYNAMIC_TYPE(GtkPrintBackendCups, gtk_print_backend_cups, GTK_TYPE_PRINT_BACKEND)
G_MODULE_EXPORT
void
g_io_module_load (GIOModule *module)
{
@ -260,11 +261,13 @@ g_io_module_load (GIOModule *module)
10);
}
G_MODULE_EXPORT
void
g_io_module_unload (GIOModule *module)
{
}
G_MODULE_EXPORT
char **
g_io_module_query (void)
{

View File

@ -103,6 +103,7 @@ static GtkPageSetup * file_printer_get_default_page_size (GtkPrinter
G_DEFINE_DYNAMIC_TYPE(GtkPrintBackendFile, gtk_print_backend_file, GTK_TYPE_PRINT_BACKEND)
G_MODULE_EXPORT
void
g_io_module_load (GIOModule *module)
{
@ -116,11 +117,13 @@ g_io_module_load (GIOModule *module)
10);
}
G_MODULE_EXPORT
void
g_io_module_unload (GIOModule *module)
{
}
G_MODULE_EXPORT
char **
g_io_module_query (void)
{

View File

@ -82,6 +82,7 @@ static void gtk_print_backend_lpr_print_stream (GtkPrintBacke
G_DEFINE_DYNAMIC_TYPE (GtkPrintBackendLpr, gtk_print_backend_lpr, GTK_TYPE_PRINT_BACKEND)
G_MODULE_EXPORT
void
g_io_module_load (GIOModule *module)
{
@ -95,11 +96,13 @@ g_io_module_load (GIOModule *module)
10);
}
G_MODULE_EXPORT
void
g_io_module_unload (GIOModule *module)
{
}
G_MODULE_EXPORT
char **
g_io_module_query (void)
{

View File

@ -8,7 +8,6 @@ printbackends_args = [
'-DGTK_COMPILATION',
'-DGTK_DISABLE_DEPRECATION_WARNINGS',
'-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED',
'-D_GLIB_EXTERN=@0@'.format(visibility_define),
] + common_cflags
cups_dep = dependency('cups', version : '>=2.0', required: get_option('print-cups'))