From 340a8e11b03368468e448cad9b12df3c7a7293f1 Mon Sep 17 00:00:00 2001 From: Qiu Wenbo Date: Fri, 22 May 2020 16:45:44 +0800 Subject: [PATCH] Build media backends with common_cflags and export the symbol Fixes: #2771 --- modules/media/gtkgstmediafile.c | 7 ++++++- modules/media/meson.build | 6 +----- modules/printbackends/gtkprintbackendcloudprint.c | 3 +++ modules/printbackends/gtkprintbackendcups.c | 3 +++ modules/printbackends/gtkprintbackendfile.c | 3 +++ modules/printbackends/gtkprintbackendlpr.c | 3 +++ 6 files changed, 19 insertions(+), 6 deletions(-) diff --git a/modules/media/gtkgstmediafile.c b/modules/media/gtkgstmediafile.c index 745ba3bc88..5988ef38c3 100644 --- a/modules/media/gtkgstmediafile.c +++ b/modules/media/gtkgstmediafile.c @@ -96,6 +96,8 @@ gtk_gst_media_file_paintable_init (GdkPaintableInterface *iface) G_DEFINE_TYPE_EXTENDED (GtkGstMediaFile, gtk_gst_media_file, GTK_TYPE_MEDIA_FILE, 0, G_IMPLEMENT_INTERFACE (GDK_TYPE_PAINTABLE, gtk_gst_media_file_paintable_init)) + +G_MODULE_EXPORT void g_io_module_load (GIOModule *module) { @@ -107,17 +109,20 @@ g_io_module_load (GIOModule *module) 10); } +G_MODULE_EXPORT +G_GNUC_NORETURN void g_io_module_unload (GIOModule *module) { g_assert_not_reached (); } +G_MODULE_EXPORT char ** g_io_module_query (void) { char *eps[] = { - GTK_MEDIA_FILE_EXTENSION_POINT_NAME, + (char *) GTK_MEDIA_FILE_EXTENSION_POINT_NAME, NULL }; diff --git a/modules/media/meson.build b/modules/media/meson.build index 8a05ccb565..c6dbed1f26 100644 --- a/modules/media/meson.build +++ b/modules/media/meson.build @@ -24,11 +24,7 @@ media_subdir = 'gtk-4.0/@0@/media'.format(gtk_binary_version) media_install_dir = join_paths(get_option('libdir'), media_subdir) extra_c_args = ['-DGTK_COMPILATION'] - -# Detect and set symbol visibility -if cc.get_id() == 'msvc' - extra_c_args += ['-D_GLIB_EXTERN=__declspec (dllexport) extern'] -endif +extra_c_args += common_cflags if media_backends.contains('ffmpeg') libavfilter_dep = dependency('libavfilter', version: '>= 6.47.100', required: true) diff --git a/modules/printbackends/gtkprintbackendcloudprint.c b/modules/printbackends/gtkprintbackendcloudprint.c index 6a5d7755af..99dc5f3665 100644 --- a/modules/printbackends/gtkprintbackendcloudprint.c +++ b/modules/printbackends/gtkprintbackendcloudprint.c @@ -103,6 +103,7 @@ void t_goa_account_free (gpointer data); G_DEFINE_DYNAMIC_TYPE (GtkPrintBackendCloudprint, gtk_print_backend_cloudprint, GTK_TYPE_PRINT_BACKEND) +G_MODULE_EXPORT void g_io_module_load (GIOModule *module) { @@ -118,11 +119,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) { diff --git a/modules/printbackends/gtkprintbackendcups.c b/modules/printbackends/gtkprintbackendcups.c index fe6150e165..e875e9403b 100644 --- a/modules/printbackends/gtkprintbackendcups.c +++ b/modules/printbackends/gtkprintbackendcups.c @@ -236,6 +236,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) { @@ -250,11 +251,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) { diff --git a/modules/printbackends/gtkprintbackendfile.c b/modules/printbackends/gtkprintbackendfile.c index 071ebec359..3486805688 100644 --- a/modules/printbackends/gtkprintbackendfile.c +++ b/modules/printbackends/gtkprintbackendfile.c @@ -102,6 +102,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) { @@ -115,11 +116,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) { diff --git a/modules/printbackends/gtkprintbackendlpr.c b/modules/printbackends/gtkprintbackendlpr.c index cef1501c30..0626e594fa 100644 --- a/modules/printbackends/gtkprintbackendlpr.c +++ b/modules/printbackends/gtkprintbackendlpr.c @@ -83,6 +83,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) { @@ -96,11 +97,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) {