mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
Redefine XINPUT_CAPABILITIES_EX as an SDL typedef
mingw-w64 has added this from Proton (which added this from SDL), so we need to re-define it as a local symbol to avoid conflicting with mingw-w64 headers.
Fixes https://github.com/libsdl-org/SDL/issues/9031
(cherry picked from commit b7c61569f8
)
This commit is contained in:
@@ -212,7 +212,7 @@ typedef struct
|
||||
#endif /* HAVE_XINPUT_H */
|
||||
|
||||
/* This struct is not defined in XInput headers. */
|
||||
typedef struct _XINPUT_CAPABILITIES_EX
|
||||
typedef struct
|
||||
{
|
||||
XINPUT_CAPABILITIES Capabilities;
|
||||
WORD VendorId;
|
||||
@@ -220,7 +220,7 @@ typedef struct _XINPUT_CAPABILITIES_EX
|
||||
WORD ProductVersion;
|
||||
WORD unk1;
|
||||
DWORD unk2;
|
||||
} XINPUT_CAPABILITIES_EX, *PXINPUT_CAPABILITIES_EX;
|
||||
} SDL_XINPUT_CAPABILITIES_EX;
|
||||
|
||||
/* Forward decl's for XInput API's we load dynamically and use if available */
|
||||
typedef DWORD(WINAPI *XInputGetState_t)(
|
||||
@@ -244,7 +244,7 @@ typedef DWORD(WINAPI *XInputGetCapabilitiesEx_t)(
|
||||
DWORD dwReserved, /* [in] Must be 1 */
|
||||
DWORD dwUserIndex, /* [in] Index of the gamer associated with the device */
|
||||
DWORD dwFlags, /* [in] Input flags that identify the device type */
|
||||
XINPUT_CAPABILITIES_EX *pCapabilitiesEx /* [out] Receives the capabilities */
|
||||
SDL_XINPUT_CAPABILITIES_EX *pCapabilitiesEx /* [out] Receives the capabilities */
|
||||
);
|
||||
|
||||
typedef DWORD(WINAPI *XInputGetBatteryInformation_t)(
|
||||
|
@@ -117,7 +117,7 @@ static const char *GetXInputName(const Uint8 userid, BYTE SubType)
|
||||
|
||||
static SDL_bool GetXInputDeviceInfo(Uint8 userid, Uint16 *pVID, Uint16 *pPID, Uint16 *pVersion)
|
||||
{
|
||||
XINPUT_CAPABILITIES_EX capabilities;
|
||||
SDL_XINPUT_CAPABILITIES_EX capabilities;
|
||||
|
||||
if (!XINPUTGETCAPABILITIESEX || XINPUTGETCAPABILITIESEX(1, userid, 0, &capabilities) != ERROR_SUCCESS) {
|
||||
return SDL_FALSE;
|
||||
@@ -143,7 +143,7 @@ static SDL_bool GetXInputDeviceInfo(Uint8 userid, Uint16 *pVID, Uint16 *pPID, Ui
|
||||
|
||||
int SDL_XINPUT_GetSteamVirtualGamepadSlot(Uint8 userid)
|
||||
{
|
||||
XINPUT_CAPABILITIES_EX capabilities;
|
||||
SDL_XINPUT_CAPABILITIES_EX capabilities;
|
||||
|
||||
if (XINPUTGETCAPABILITIESEX &&
|
||||
XINPUTGETCAPABILITIESEX(1, userid, 0, &capabilities) == ERROR_SUCCESS &&
|
||||
|
Reference in New Issue
Block a user