[vlc-commits] direct3d: fix forcing the minimum _WIN32_WINNT
Steve Lhomme
git at videolan.org
Fri Mar 13 10:28:31 CET 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Mar 13 08:05:37 2020 +0100| [4cb707be548fd2bbc202beca04826159e8663155] | committer: Steve Lhomme
direct3d: fix forcing the minimum _WIN32_WINNT
The value should be set before including any Windows headers and thus should
not be using a value that is defined in Windows headers. Currently a no-op for
that reason.
Ultimately we might get rid of these as we officially support Windows 7 as the
minimum required to run VLC 4.0.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4cb707be548fd2bbc202beca04826159e8663155
---
modules/codec/avcodec/directx_va.h | 4 ++--
modules/video_output/win32/d3d11_quad.c | 10 +++++-----
modules/video_output/win32/d3d11_shaders.c | 10 +++++-----
modules/video_output/win32/d3d11_swapchain.c | 7 ++++---
modules/video_output/win32/direct3d11.c | 10 +++++-----
5 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/modules/codec/avcodec/directx_va.h b/modules/codec/avcodec/directx_va.h
index 80663674ef..8a0d250abb 100644
--- a/modules/codec/avcodec/directx_va.h
+++ b/modules/codec/avcodec/directx_va.h
@@ -27,10 +27,10 @@
#ifndef AVCODEC_DIRECTX_VA_H
#define AVCODEC_DIRECTX_VA_H
-# if _WIN32_WINNT < _WIN32_WINNT_VISTA
+# if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600 // _WIN32_WINNT_VISTA
/* d3d11 needs Vista support */
# undef _WIN32_WINNT
-# define _WIN32_WINNT _WIN32_WINNT_VISTA
+# define _WIN32_WINNT 0x0600 // _WIN32_WINNT_VISTA
# endif
#include <vlc_common.h>
diff --git a/modules/video_output/win32/d3d11_quad.c b/modules/video_output/win32/d3d11_quad.c
index 41dea2950b..ca06da6b45 100644
--- a/modules/video_output/win32/d3d11_quad.c
+++ b/modules/video_output/win32/d3d11_quad.c
@@ -24,14 +24,14 @@
# include "config.h"
#endif
-#include <assert.h>
-#include <vlc_common.h>
-
-#if !defined(_WIN32_WINNT) || _WIN32_WINNT < _WIN32_WINNT_WIN7
+#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0601 // _WIN32_WINNT_WIN7
# undef _WIN32_WINNT
-# define _WIN32_WINNT _WIN32_WINNT_WIN7
+# define _WIN32_WINNT 0x0601 // _WIN32_WINNT_WIN7
#endif
+#include <assert.h>
+#include <vlc_common.h>
+
#define COBJMACROS
#include <d3d11.h>
diff --git a/modules/video_output/win32/d3d11_shaders.c b/modules/video_output/win32/d3d11_shaders.c
index 09826bf521..285543e8c3 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -20,15 +20,15 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-#if !defined(_WIN32_WINNT) || _WIN32_WINNT < _WIN32_WINNT_WIN7
-# undef _WIN32_WINNT
-# define _WIN32_WINNT _WIN32_WINNT_WIN7
-#endif
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
+#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0601 // _WIN32_WINNT_WIN7
+# undef _WIN32_WINNT
+# define _WIN32_WINNT 0x0601 // _WIN32_WINNT_WIN7
+#endif
+
#include <vlc_common.h>
#include <assert.h>
diff --git a/modules/video_output/win32/d3d11_swapchain.c b/modules/video_output/win32/d3d11_swapchain.c
index 2360854bd3..13d7911565 100644
--- a/modules/video_output/win32/d3d11_swapchain.c
+++ b/modules/video_output/win32/d3d11_swapchain.c
@@ -33,12 +33,13 @@
#include <assert.h>
-#include <windows.h>
-#if !defined(_WIN32_WINNT) || _WIN32_WINNT < _WIN32_WINNT_WIN7
+#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0601 // _WIN32_WINNT_WIN7
# undef _WIN32_WINNT
-# define _WIN32_WINNT _WIN32_WINNT_WIN7
+# define _WIN32_WINNT 0x0601 // _WIN32_WINNT_WIN7
#endif
+#include <windows.h>
+
#define COBJMACROS
#include <initguid.h>
#include <d3d11.h>
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index d6558e21e3..e365f24e09 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -25,6 +25,11 @@
# include "config.h"
#endif
+#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0601 // _WIN32_WINNT_WIN7
+# undef _WIN32_WINNT
+# define _WIN32_WINNT 0x0601 // _WIN32_WINNT_WIN7
+#endif
+
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_vout_display.h>
@@ -38,11 +43,6 @@
#include <assert.h>
#include <math.h>
-#if !defined(_WIN32_WINNT) || _WIN32_WINNT < _WIN32_WINNT_WIN7
-# undef _WIN32_WINNT
-# define _WIN32_WINNT _WIN32_WINNT_WIN7
-#endif
-
#define COBJMACROS
#include <initguid.h>
#include <d3d11.h>
More information about the vlc-commits
mailing list