[2/2] Drop Windows XP support remnants

Message ID 20180405084614.14545-2-diego@biurrun.de
State Committed
Commit 8f144d9e3d5cb2ca92e5bdf7cc9f72effa1bd2ce
Headers show
Series
  • [1/2] w32pthreads: always use Vista+ API, drop XP support
Related show

Commit Message

Diego Biurrun April 5, 2018, 8:46 a.m.
---
 libavcodec/dxva2_h264.c       | 6 +-----
 libavcodec/dxva2_hevc.c       | 6 +-----
 libavcodec/dxva2_mpeg2.c      | 7 ++-----
 libavcodec/dxva2_vc1.c        | 6 +-----
 libavutil/hwcontext_d3d11va.c | 9 +--------
 libavutil/hwcontext_dxva2.c   | 4 ----
 6 files changed, 6 insertions(+), 32 deletions(-)

Comments

Martin Storsjö April 5, 2018, 8:46 p.m. | #1
On Thu, 5 Apr 2018, Diego Biurrun wrote:

> ---
> libavcodec/dxva2_h264.c       | 6 +-----
> libavcodec/dxva2_hevc.c       | 6 +-----
> libavcodec/dxva2_mpeg2.c      | 7 ++-----
> libavcodec/dxva2_vc1.c        | 6 +-----
> libavutil/hwcontext_d3d11va.c | 9 +--------
> libavutil/hwcontext_dxva2.c   | 4 ----
> 6 files changed, 6 insertions(+), 32 deletions(-)
>
> diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c
> index 50e7863bf2..790e4a214b 100644
> --- a/libavcodec/dxva2_h264.c
> +++ b/libavcodec/dxva2_h264.c
> @@ -20,16 +20,12 @@
>  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>  */
> 
> +#include "dxva2_internal.h"
> #include "h264dec.h"
> #include "h264data.h"
> #include "h264_ps.h"
> #include "mpegutils.h"
> 
> -// The headers above may include w32threads.h, which uses the original
> -// _WIN32_WINNT define, while dxva2_internal.h redefines it to target a
> -// potentially newer version.
> -#include "dxva2_internal.h"

Well technically, this hasn't changed - dxva2_internal.h includes dxva2.h 
which still redefines _WIN32_WINNT.

It just sets it to 0x0602, while the lowest it'll be here from before is 
0x0600 and the difference shouldn't matter for e.g. w32threads.h.

The patch probably is fine though, but reading the patch made me grep the 
source to see what the actual case was.

// Martin

Patch

diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c
index 50e7863bf2..790e4a214b 100644
--- a/libavcodec/dxva2_h264.c
+++ b/libavcodec/dxva2_h264.c
@@ -20,16 +20,12 @@ 
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "dxva2_internal.h"
 #include "h264dec.h"
 #include "h264data.h"
 #include "h264_ps.h"
 #include "mpegutils.h"
 
-// The headers above may include w32threads.h, which uses the original
-// _WIN32_WINNT define, while dxva2_internal.h redefines it to target a
-// potentially newer version.
-#include "dxva2_internal.h"
-
 struct dxva2_picture_context {
     DXVA_PicParams_H264   pp;
     DXVA_Qmatrix_H264     qm;
diff --git a/libavcodec/dxva2_hevc.c b/libavcodec/dxva2_hevc.c
index 02d3b9b152..d2d80802a2 100644
--- a/libavcodec/dxva2_hevc.c
+++ b/libavcodec/dxva2_hevc.c
@@ -22,14 +22,10 @@ 
 
 #include "libavutil/avassert.h"
 
+#include "dxva2_internal.h"
 #include "hevc_data.h"
 #include "hevcdec.h"
 
-// The headers above may include w32threads.h, which uses the original
-// _WIN32_WINNT define, while dxva2_internal.h redefines it to target a
-// potentially newer version.
-#include "dxva2_internal.h"
-
 #define MAX_SLICES 256
 
 struct hevc_dxva2_picture_context {
diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c
index 6e5dff308f..5cc8128100 100644
--- a/libavcodec/dxva2_mpeg2.c
+++ b/libavcodec/dxva2_mpeg2.c
@@ -21,13 +21,10 @@ 
  */
 
 #include "libavutil/log.h"
-#include "mpegutils.h"
-#include "mpegvideo.h"
 
-// The headers above may include w32threads.h, which uses the original
-// _WIN32_WINNT define, while dxva2_internal.h redefines it to target a
-// potentially newer version.
 #include "dxva2_internal.h"
+#include "mpegutils.h"
+#include "mpegvideo.h"
 
 #define MAX_SLICES 1024
 struct dxva2_picture_context {
diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c
index 247ea47825..fc09f88f05 100644
--- a/libavcodec/dxva2_vc1.c
+++ b/libavcodec/dxva2_vc1.c
@@ -20,15 +20,11 @@ 
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "dxva2_internal.h"
 #include "mpegutils.h"
 #include "vc1.h"
 #include "vc1data.h"
 
-// The headers above may include w32threads.h, which uses the original
-// _WIN32_WINNT define, while dxva2_internal.h redefines it to target a
-// potentially newer version.
-#include "dxva2_internal.h"
-
 struct dxva2_picture_context {
     DXVA_PictureParameters pp;
     DXVA_SliceInfo         si;
diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c
index 0a8cc5bc21..6488fc2203 100644
--- a/libavutil/hwcontext_d3d11va.c
+++ b/libavutil/hwcontext_d3d11va.c
@@ -20,14 +20,6 @@ 
 
 #include <windows.h>
 
-// Include thread.h before redefining _WIN32_WINNT, to get
-// the right implementation for AVOnce
-#include "thread.h"
-
-#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0600
-#endif
 #define COBJMACROS
 
 #include <initguid.h>
@@ -46,6 +38,7 @@ 
 #include "imgutils.h"
 #include "pixdesc.h"
 #include "pixfmt.h"
+#include "thread.h"
 
 typedef HRESULT(WINAPI *PFN_CREATE_DXGI_FACTORY)(REFIID riid, void **ppFactory);
 
diff --git a/libavutil/hwcontext_dxva2.c b/libavutil/hwcontext_dxva2.c
index d1b19ab237..bf9a3a9c11 100644
--- a/libavutil/hwcontext_dxva2.c
+++ b/libavutil/hwcontext_dxva2.c
@@ -18,10 +18,6 @@ 
 
 #include <windows.h>
 
-#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0600
-#endif
 #define DXVA2API_USE_BITFIELDS
 #define COBJMACROS