From 3751065f9740244c95da963c0dd16a0bcd5b419c Mon Sep 17 00:00:00 2001 From: James Ross-Gowan Date: Tue, 27 Sep 2016 22:44:18 +1000 Subject: win32: build with -DINITGUID We always want to use __declspec(selectany) to declare GUIDs, but manually including in every file that used GUIDs was error-prone. Since all does is define INITGUID and include , we can remove all references to and just compile with -DINITGUID to get the same effect. Also, this partially reverts 622bcb0 by re-adding libuuid.a to the build, since apparently some GUIDs (such as GUID_NULL) are not declared in the source file, even when INITGUID is set. --- audio/out/ao_wasapi_changenotify.c | 1 - audio/out/ao_wasapi_utils.c | 1 - osdep/path-win.c | 1 - video/decode/d3d.c | 3 ++- video/decode/d3d11va.c | 1 - video/decode/dxva2.c | 2 -- video/filter/vf_d3d11vpp.c | 1 - video/out/opengl/context_angle.c | 1 - video/out/opengl/context_dxinterop.c | 1 - video/out/opengl/hwdec_d3d11egl.c | 1 - video/out/opengl/hwdec_d3d11eglrgb.c | 1 - video/out/w32_common.c | 1 - waftools/detections/compiler.py | 2 +- waftools/fragments/wasapi.c | 1 - wscript | 2 +- 15 files changed, 4 insertions(+), 16 deletions(-) diff --git a/audio/out/ao_wasapi_changenotify.c b/audio/out/ao_wasapi_changenotify.c index 46843ec5e3..e1b3a9d604 100644 --- a/audio/out/ao_wasapi_changenotify.c +++ b/audio/out/ao_wasapi_changenotify.c @@ -17,7 +17,6 @@ * License along with mpv. If not, see . */ -#include #include #include "ao_wasapi.h" diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c index 6218153bea..320bb6767b 100644 --- a/audio/out/ao_wasapi_utils.c +++ b/audio/out/ao_wasapi_utils.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/osdep/path-win.c b/osdep/path-win.c index de7c0936f7..8f289ff83a 100644 --- a/osdep/path-win.c +++ b/osdep/path-win.c @@ -17,7 +17,6 @@ #include #include -#include #include #include diff --git a/video/decode/d3d.c b/video/decode/d3d.c index b50f3a0288..d2c2c9745b 100644 --- a/video/decode/d3d.c +++ b/video/decode/d3d.c @@ -31,7 +31,8 @@ // define all the GUIDs used directly here, to avoid problems with inconsistent // dxva2api.h versions in mingw-w64 and different MSVC version -#include +#include +#include DEFINE_GUID(DXVA2_ModeMPEG2_VLD, 0xee27417f, 0x5e28, 0x4e65, 0xbe, 0xea, 0x1d, 0x26, 0xb5, 0x08, 0xad, 0xc9); DEFINE_GUID(DXVA2_ModeMPEG2and1_VLD, 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60); diff --git a/video/decode/d3d11va.c b/video/decode/d3d11va.c index d929e1e70f..8ce07880e7 100644 --- a/video/decode/d3d11va.c +++ b/video/decode/d3d11va.c @@ -15,7 +15,6 @@ * 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 fc52aca03b..ab91c186df 100644 --- a/video/decode/dxva2.c +++ b/video/decode/dxva2.c @@ -19,8 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include - #define DXVA2API_USE_BITFIELDS #include diff --git a/video/filter/vf_d3d11vpp.c b/video/filter/vf_d3d11vpp.c index 7a52565782..9e02abeafe 100644 --- a/video/filter/vf_d3d11vpp.c +++ b/video/filter/vf_d3d11vpp.c @@ -15,7 +15,6 @@ * License along with mpv. If not, see . */ -#include #include #include #include diff --git a/video/out/opengl/context_angle.c b/video/out/opengl/context_angle.c index b0d637cebd..44aed340e3 100644 --- a/video/out/opengl/context_angle.c +++ b/video/out/opengl/context_angle.c @@ -15,7 +15,6 @@ * License along with mpv. If not, see . */ -#include #include #include #include diff --git a/video/out/opengl/context_dxinterop.c b/video/out/opengl/context_dxinterop.c index 95b9296b3a..a4b979d8d4 100644 --- a/video/out/opengl/context_dxinterop.c +++ b/video/out/opengl/context_dxinterop.c @@ -17,7 +17,6 @@ #include #include -#include #include #include #include "osdep/windows_utils.h" diff --git a/video/out/opengl/hwdec_d3d11egl.c b/video/out/opengl/hwdec_d3d11egl.c index 4360286064..690609b5b9 100644 --- a/video/out/opengl/hwdec_d3d11egl.c +++ b/video/out/opengl/hwdec_d3d11egl.c @@ -15,7 +15,6 @@ * License along with mpv. If not, see . */ -#include #include #include #include diff --git a/video/out/opengl/hwdec_d3d11eglrgb.c b/video/out/opengl/hwdec_d3d11eglrgb.c index d43b1f503b..31e63eb8da 100644 --- a/video/out/opengl/hwdec_d3d11eglrgb.c +++ b/video/out/opengl/hwdec_d3d11eglrgb.c @@ -15,7 +15,6 @@ * 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 64c3e700aa..736da59dff 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -15,7 +15,6 @@ * with mpv. If not, see . */ -#include #include #include #include diff --git a/waftools/detections/compiler.py b/waftools/detections/compiler.py index 900128ce4c..5bbba87fd7 100644 --- a/waftools/detections/compiler.py +++ b/waftools/detections/compiler.py @@ -52,7 +52,7 @@ def __add_clang_flags__(ctx): def __add_mswin_flags__(ctx): ctx.env.CFLAGS += ['-D_WIN32_WINNT=0x0601', '-DUNICODE', '-DCOBJMACROS', - '-U__STRICT_ANSI__'] + '-DINITGUID', '-U__STRICT_ANSI__'] ctx.env.LAST_LINKFLAGS += ['-Wl,--major-os-version=6,--minor-os-version=0', '-Wl,--major-subsystem-version=6,--minor-subsystem-version=0'] diff --git a/waftools/fragments/wasapi.c b/waftools/fragments/wasapi.c index 5528ce171b..fbd2bb6e1b 100644 --- a/waftools/fragments/wasapi.c +++ b/waftools/fragments/wasapi.c @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include diff --git a/wscript b/wscript index 13cb5269ee..7dea08b8db 100644 --- a/wscript +++ b/wscript @@ -135,7 +135,7 @@ main_dependencies = [ 'name': 'win32', 'desc': 'win32', 'deps_any': [ 'os-win32', 'os-cygwin' ], - 'func': check_cc(lib=['winmm', 'gdi32', 'ole32', 'avrt', 'dwmapi']), + 'func': check_cc(lib=['winmm', 'gdi32', 'ole32', 'uuid', 'avrt', 'dwmapi']), }, { 'name': '--win32-internal-pthreads', 'desc': 'internal pthread wrapper for win32 (Vista+)', -- cgit v1.2.3