Skip to content

[3.0.x] d3d11_deinterlace: fix compilation with mingw >= 6

Newer d3d11.h already defines the enum, resulting in the following error:

    ../../modules/hw/d3d11/d3d11_deinterlace.c:43:14: error: redefinition of typedef ‘D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS’ with different type
       43 | typedef UINT D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS;
          |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from ../../modules/hw/d3d11/d3d11_deinterlace.c:36:
    /usr/share/mingw-w64/include/d3d11.h:954:3: note: previous declaration of ‘D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS’ with type ‘D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS’
      954 | } D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS;
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS is available since MinGW-W64 6.0.0: https://github.com/mirror/mingw-w64/commit/474a85ab51aadbe24a03081684d9cd17dcc3b353

Contribs d3d11.h doesn't have it, but distro-provided d3d11.h does, so check if the type is available.

For 4.0 this was fixed with d357b49f, but (I think?) 3.0.x supports an older MinGW, so the typedef can't just be dropped.

Edited by Johannes Kauffmann

Merge request reports