From 7c55845c804e2272df8bc111dea5d3e9d11670a0 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 2 Jun 2023 11:20:31 -0700 Subject: [PATCH] Fixed build if SDL_JOYSTICK_RAWINPUT_MATCHING isn't enabled --- src/joystick/windows/SDL_rawinputjoystick.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c index 2a99da04cf..e7ec405218 100644 --- a/src/joystick/windows/SDL_rawinputjoystick.c +++ b/src/joystick/windows/SDL_rawinputjoystick.c @@ -1107,7 +1107,9 @@ static int RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index) ctx->is_xinput = device->is_xinput; ctx->is_xboxone = device->is_xboxone; +#ifdef SDL_JOYSTICK_RAWINPUT_MATCHING ctx->match_state = 0x0000008800000000ULL; /* Trigger axes at rest */ +#endif ctx->preparsed_data = device->preparsed_data; ctx->max_data_length = SDL_HidP_MaxDataListLength(HidP_Input, ctx->preparsed_data); ctx->data = (HIDP_DATA *)SDL_malloc(ctx->max_data_length * sizeof(*ctx->data));