From 5e1a753f884aeb6e6b306ec89b99c1d55cc88aab Mon Sep 17 00:00:00 2001 From: nmlgc Date: Mon, 13 Oct 2025 08:20:38 +0200 Subject: [PATCH] =?UTF-8?q?windowsdialog:=20Fix=20broken=20=E2=89=A4XP=20f?= =?UTF-8?q?allback=20declarations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The syntax errors in the enum lists tell us that no one ever actually compiled this `WINVER < _WIN32_WINNT_VISTA` fallback path. 2f5bc17 made it increasingly unlikely for retro Windows builds to hit this path by adding a new set of `WINVER` override rules to `SDL_windows.h` that check for the presence of certain headers. `HAVE_MMDEVICEAPI_H` in particular will be `#define`d for any CMake build with a ≥Vista-era SDK, such as Visual Studio 2017's `v141_xp` toolset that 2f5bc17 targeted, and it's also unconditionally defined in the default `SDL_build_config_windows.h` configuration used by the ready-made Visual Studio project. These fixes work for a XP-era configuration that undefines all of the `HAVE_*_H` macros and `SDL_VIDEO_RENDER_D3D12` to make `SDL_windows.h` fall through to the `#define _WIN32_WINNT _WIN32_WINNT_WINXP` case, on both Visual Studio 2022 and Visual Studio 2017's `v141_xp` toolset. --- src/dialog/windows/SDL_windowsdialog.c | 43 +++++--------------------- 1 file changed, 8 insertions(+), 35 deletions(-) diff --git a/src/dialog/windows/SDL_windowsdialog.c b/src/dialog/windows/SDL_windowsdialog.c index 3009df58be..b10f82fabb 100644 --- a/src/dialog/windows/SDL_windowsdialog.c +++ b/src/dialog/windows/SDL_windowsdialog.c @@ -38,52 +38,25 @@ typedef struct _COMDLG_FILTERSPEC typedef enum FDE_OVERWRITE_RESPONSE { - FDEOR_DEFAULT - FDEOR_ACCEPT - FDEOR_REFUSE + FDEOR_DEFAULT, + FDEOR_ACCEPT, + FDEOR_REFUSE, } FDE_OVERWRITE_RESPONSE; typedef enum FDE_SHAREVIOLATION_RESPONSE { - FDESVR_DEFAULT - FDESVR_ACCEPT - FDESVR_REFUSE + FDESVR_DEFAULT, + FDESVR_ACCEPT, + FDESVR_REFUSE, } FDE_SHAREVIOLATION_RESPONSE; typedef enum FDAP { - FDAP_BOTTOM - FDAP_TOP + FDAP_BOTTOM, + FDAP_TOP, } FDAP; typedef ULONG SFGAOF; - -typedef enum GETPROPERTYSTOREFLAGS -{ - GPS_DEFAULT = 0x0, - GPS_HANDLERPROPERTIESONLY = 0x1, - GPS_READWRITE = 0x2, - GPS_TEMPORARY = 0x4, - GPS_FASTPROPERTIESONLY = 0x8, - GPS_OPENSLOWITEM = 0x10, - GPS_DELAYCREATION = 0x20, - GPS_BESTEFFORT = 0x40, - GPS_NO_OPLOCK = 0x80, - GPS_PREFERQUERYPROPERTIES = 0x100, - GPS_EXTRINSICPROPERTIES = 0x200, - GPS_EXTRINSICPROPERTIESONLY = 0x400, - GPS_VOLATILEPROPERTIES = 0x800, - GPS_VOLATILEPROPERTIESONLY = 0x1000, - GPS_MASK_VALID = 0x1FFF -} GETPROPERTYSTOREFLAGS; - -typedef struct _tagpropertykey { - GUID fmtid; - DWORD pid; -} PROPERTYKEY; - -#define REFPROPERTYKEY const PROPERTYKEY * const - typedef DWORD SHCONTF; #endif // WINVER < _WIN32_WINNT_VISTA