diff options
author | Seungha Yang <seungha@centricular.com> | 2021-04-22 15:32:09 +0900 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-07-01 12:46:04 +0000 |
commit | 66ccc91944a417e0b2d12d269d29550c07a80e29 (patch) | |
tree | 0d061da8ffc279e2abe42dda3238585a27b60051 | |
parent | 8837bb99d44a1b8c936ba94e1e564922631ca78f (diff) |
glib: Fix Visual Studio 2019 build error
Apply upstream commit https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1428
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/699>
-rw-r--r-- | recipes/glib.recipe | 2 | ||||
-rw-r--r-- | recipes/glib/0001-Add-missing-extern-to-the-dllexport-version-of-GLIB_.patch | 46 |
2 files changed, 48 insertions, 0 deletions
diff --git a/recipes/glib.recipe b/recipes/glib.recipe index e9bc0dbd..6e85dfa5 100644 --- a/recipes/glib.recipe +++ b/recipes/glib.recipe @@ -58,6 +58,8 @@ class Recipe(recipe.Recipe): 'glib/0001-gioerror-Map-WSAENETRESET-on-Windows-to-G_IO_ERROR_C.patch', # https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1836 'glib/0001-Windows-fix-FD_READ-condition-flag-still-set-on-reco.patch', + # https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1428 + 'glib/0001-Add-missing-extern-to-the-dllexport-version-of-GLIB_.patch', ] files_libs = [ diff --git a/recipes/glib/0001-Add-missing-extern-to-the-dllexport-version-of-GLIB_.patch b/recipes/glib/0001-Add-missing-extern-to-the-dllexport-version-of-GLIB_.patch new file mode 100644 index 00000000..0a7d5771 --- /dev/null +++ b/recipes/glib/0001-Add-missing-extern-to-the-dllexport-version-of-GLIB_.patch @@ -0,0 +1,46 @@ +From fdfadfc27604b58886d7a33cf5f78bb0617733e6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st> +Date: Tue, 31 Mar 2020 23:15:23 +0300 +Subject: [PATCH] Add missing 'extern' to the dllexport version of + GLIB_VAR/GOBJECT_VAR + +The __declspec(dllexport) attribute in itself doesn't imply +'extern' - thus any intended variable declaration with +GLIB_VAR/GOBJECT_VAR would actually be a variable definition. With +C compilers defaulting to -fcommon, this isn't an issue, but +upcoming compilers (GCC 10 and Clang 11) will default to -fno-common, +ending up with duplicate definitions of these variables. +--- + glib/gtypes.h | 2 +- + gobject/gparamspecs.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/glib/gtypes.h b/glib/gtypes.h +index df65836a0..23c5a1295 100644 +--- a/glib/gtypes.h ++++ b/glib/gtypes.h +@@ -565,7 +565,7 @@ G_END_DECLS + # else /* !GLIB_STATIC_COMPILATION */ + # ifdef GLIB_COMPILATION + # ifdef DLL_EXPORT +-# define GLIB_VAR __declspec(dllexport) ++# define GLIB_VAR extern __declspec(dllexport) + # else /* !DLL_EXPORT */ + # define GLIB_VAR extern + # endif /* !DLL_EXPORT */ +diff --git a/gobject/gparamspecs.h b/gobject/gparamspecs.h +index 0309f9bb3..d0e4d5953 100644 +--- a/gobject/gparamspecs.h ++++ b/gobject/gparamspecs.h +@@ -1150,7 +1150,7 @@ GParamSpec* g_param_spec_variant (const gchar *name, + # else /* !GOBJECT_STATIC_COMPILATION */ + # ifdef GOBJECT_COMPILATION + # ifdef DLL_EXPORT +-# define GOBJECT_VAR __declspec(dllexport) ++# define GOBJECT_VAR extern __declspec(dllexport) + # else /* !DLL_EXPORT */ + # define GOBJECT_VAR extern + # endif /* !DLL_EXPORT */ +-- +2.25.1 + |