forked from AuroraMiddleware/gtk
Merge branch 'fix-msvc-older-glib' into 'main'
modules/media: Fix Visual Studio builds with older GLib (<= 2.74.x) See merge request GNOME/gtk!5605
This commit is contained in:
commit
bdd35c1695
@ -370,6 +370,13 @@ glib_dep = dependency('glib-2.0', version: glib_req)
|
|||||||
gobject_dep = dependency('gobject-2.0', version: glib_req)
|
gobject_dep = dependency('gobject-2.0', version: glib_req)
|
||||||
if os_win32
|
if os_win32
|
||||||
giowin32_dep = dependency('gio-windows-2.0', version: glib_req, required: win32_enabled)
|
giowin32_dep = dependency('gio-windows-2.0', version: glib_req, required: win32_enabled)
|
||||||
|
if giowin32_dep.version().version_compare('<2.75.0')
|
||||||
|
if cc.get_id() == 'msvc' and get_option('default_library') != 'static'
|
||||||
|
# Override _GLIB_EXTERN on Visual Studio for media modules for glib <= 2.74.x, so that we
|
||||||
|
# avoid error C2375 (redefinition; different linkage) when building the g_io_module_*() bits
|
||||||
|
cdata.set('MODULES_OVERRIDE_GLIB_EXTERN', true)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
if os_unix
|
if os_unix
|
||||||
giounix_dep = dependency('gio-unix-2.0', version: glib_req, required: false)
|
giounix_dep = dependency('gio-unix-2.0', version: glib_req, required: false)
|
||||||
|
@ -19,6 +19,15 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sadly, we need this to build on Visual Studio against glib-2.74.x or earlier,
|
||||||
|
* otherwise the build will fail when building the g_io_module_*() bits with error C2375
|
||||||
|
* (redefinition; different linkage). This must be before including the Gio headers.
|
||||||
|
*/
|
||||||
|
#if defined (_MSC_VER) && defined (MODULES_OVERRIDE_GLIB_EXTERN)
|
||||||
|
# define _GLIB_EXTERN __declspec(dllexport) extern
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "gtkffmediafileprivate.h"
|
#include "gtkffmediafileprivate.h"
|
||||||
|
|
||||||
#include <glib/gi18n-lib.h>
|
#include <glib/gi18n-lib.h>
|
||||||
|
@ -19,6 +19,15 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sadly, we need this to build on Visual Studio against glib-2.74.x or earlier,
|
||||||
|
* otherwise the build will fail when building the g_io_module_*() bits with error C2375
|
||||||
|
* (redefinition; different linkage). This must be before including the Gio headers.
|
||||||
|
*/
|
||||||
|
#if defined (_MSC_VER) && defined (MODULES_OVERRIDE_GLIB_EXTERN)
|
||||||
|
# define _GLIB_EXTERN __declspec(dllexport) extern
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "gtkgstmediafileprivate.h"
|
#include "gtkgstmediafileprivate.h"
|
||||||
#include "gtkgstpaintableprivate.h"
|
#include "gtkgstpaintableprivate.h"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user