From 622bcb0e37f39f2a542b42587ca442c6600b7414 Mon Sep 17 00:00:00 2001 From: James Ross-Gowan Date: Sun, 1 May 2016 01:49:38 +1000 Subject: [PATCH] win32: replace libuuid.a usage with initguid.h Including initguid.h at the top of a file that uses references to GUIDs causes the GUIDs to be declared globally with __declspec(selectany). The 'selectany' attribute tells the linker to consolidate multiple definitions of each GUID, which would be great except that, in Cygwin and MinGW GCC 6.1, this method of linking makes the GUIDs conflict with the ones declared in libuuid.a. Since initguid.h obsoletes libuuid.a in modern compilers that support __declspec(selectany), add initguid.h to all files that use GUIDs and remove libuuid.a from the build. Fixes #3097 --- audio/out/ao_wasapi_changenotify.c | 1 + video/decode/d3d11va.c | 1 + video/decode/dxva2.c | 2 ++ video/out/opengl/hwdec_d3d11egl.c | 1 + video/out/w32_common.c | 2 +- wscript | 2 +- 6 files changed, 7 insertions(+), 2 deletions(-) diff --git a/audio/out/ao_wasapi_changenotify.c b/audio/out/ao_wasapi_changenotify.c index 661e957bcc..e3ca4e4936 100644 --- a/audio/out/ao_wasapi_changenotify.c +++ b/audio/out/ao_wasapi_changenotify.c @@ -17,6 +17,7 @@ * License along with mpv. If not, see . */ +#include #include #include "ao_wasapi.h" diff --git a/video/decode/d3d11va.c b/video/decode/d3d11va.c index a20d0e46ec..246a35ec9a 100644 --- a/video/decode/d3d11va.c +++ b/video/decode/d3d11va.c @@ -15,6 +15,7 @@ * License along with mpv. If not, see . */ +#include #include #include "lavc.h" diff --git a/video/decode/dxva2.c b/video/decode/dxva2.c index c851859b6b..70623c8fb4 100644 --- a/video/decode/dxva2.c +++ b/video/decode/dxva2.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #define DXVA2API_USE_BITFIELDS #include diff --git a/video/out/opengl/hwdec_d3d11egl.c b/video/out/opengl/hwdec_d3d11egl.c index 66df9983d1..32fb42a692 100644 --- a/video/out/opengl/hwdec_d3d11egl.c +++ b/video/out/opengl/hwdec_d3d11egl.c @@ -15,6 +15,7 @@ * License along with mpv. If not, see . */ +#include #include #include #include diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 042e81b7fe..e858f037aa 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -15,13 +15,13 @@ * with mpv. If not, see . */ +#include #include #include #include #include #include #include -#include #include #include #include diff --git a/wscript b/wscript index a4ffce6031..061b14ee61 100644 --- a/wscript +++ b/wscript @@ -140,7 +140,7 @@ main_dependencies = [ 'name': 'win32', 'desc': 'win32', 'deps_any': [ 'os-win32', 'os-cygwin' ], - 'func': check_cc(lib=['winmm', 'gdi32', 'ole32', 'uuid', 'avrt', 'dwmapi']), + 'func': check_cc(lib=['winmm', 'gdi32', 'ole32', 'avrt', 'dwmapi']), }, { 'name': '--win32-internal-pthreads', 'desc': 'internal pthread wrapper for win32 (Vista+)',