Merge branch 'master.msvc' into 'master'

Fix latest GTK master on Visual Studio

See merge request GNOME/gtk!2028
This commit is contained in:
Matthias Clasen 2020-06-05 18:31:08 +00:00
commit 34841c3a5f
10 changed files with 20 additions and 22 deletions

View File

@ -11,6 +11,8 @@
#include <gtk/gtk.h>
#include <stdlib.h>
#define GTK_TYPE_COLOR (gtk_color_get_type ())
G_DECLARE_FINAL_TYPE (GtkColor, gtk_color, GTK, COLOR, GObject)

View File

@ -9,6 +9,8 @@
#include <gtk/gtk.h>
#include <stdlib.h>
/* Create an object that wraps GSettingsSchemaKey because that's a boxed type */
typedef struct _SettingsKey SettingsKey;
struct _SettingsKey

View File

@ -286,15 +286,19 @@ 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)
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')
endif
if cc.get_id() != 'msvc'
common_cflags += ['-fvisibility=hidden']
endif
endif

View File

@ -97,7 +97,6 @@ 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)
{
@ -109,7 +108,6 @@ g_io_module_load (GIOModule *module)
10);
}
G_MODULE_EXPORT
G_GNUC_NORETURN
void
g_io_module_unload (GIOModule *module)
@ -117,7 +115,6 @@ g_io_module_unload (GIOModule *module)
g_assert_not_reached ();
}
G_MODULE_EXPORT
char **
g_io_module_query (void)
{

View File

@ -23,7 +23,11 @@ endif
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']
extra_c_args = [
'-DGTK_COMPILATION',
'-D_GLIB_EXTERN=@0@'.format(visibility_define),
]
extra_c_args += common_cflags
if media_backends.contains('ffmpeg')

View File

@ -103,7 +103,6 @@ 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)
{
@ -119,13 +118,11 @@ 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

@ -236,7 +236,6 @@ 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)
{
@ -251,13 +250,11 @@ 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

@ -102,7 +102,6 @@ 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,13 +115,11 @@ 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

@ -83,7 +83,6 @@ 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)
{
@ -97,13 +96,11 @@ 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

@ -68,6 +68,7 @@ printbackends_args = [
'-DGTK_COMPILATION',
'-DGTK_DISABLE_DEPRECATION_WARNINGS',
'-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED',
'-D_GLIB_EXTERN=@0@'.format(visibility_define),
] + common_cflags
if print_backends.contains('cups')