Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ include(CheckIncludeFiles)
include(CheckLanguage)
include(CheckSymbolExists)
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
include(CheckCSourceRuns)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
Expand Down Expand Up @@ -2314,7 +2315,7 @@ elseif(WINDOWS)
static __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics2 *s2;
int main(int argc, char **argv) { return 0; }" HAVE_WINDOWS_GAMING_INPUT_H
)
check_c_source_compiles("
check_cxx_source_compiles("
#include <stdbool.h>
#define COBJMACROS
#include <gameinput.h>
Expand Down
2 changes: 1 addition & 1 deletion include/SDL3/SDL_stdinc.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void *alloca(size_t);
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) /* or `_Countof(array)` on recent gcc and clang */

#else
#if (defined(__GNUC__) && __GNUC__ >= 16) || SDL_HAS_EXTENSION(c_countof)
#if !defined(__cplusplus) && ((defined(__GNUC__) && __GNUC__ >= 16) || SDL_HAS_EXTENSION(c_countof))
#define SDL_arraysize(array) _Countof(array)
#else
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
Expand Down
9 changes: 9 additions & 0 deletions src/core/windows/SDL_gameinput.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,17 @@

#ifdef HAVE_GAMEINPUT_H

#ifdef HAVE_GCC_DIAGNOSTIC_PRAGMA
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wundef"
#endif

#include <gameinput.h>

#ifdef HAVE_GCC_DIAGNOSTIC_PRAGMA
#pragma GCC diagnostic pop
#endif

#ifndef GAMEINPUT_API_VERSION
#define GAMEINPUT_API_VERSION 0
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/joystick/gdk/SDL_gameinputjoystick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ static bool GAMEINPUT_InternalAddOrFind(IGameInputDevice *pDevice)

// Generate a device path
for (idx = 0; idx < APP_LOCAL_DEVICE_ID_SIZE; ++idx) {
SDL_snprintf(tmp, SDL_arraysize(tmp), "%02hhX", info->deviceId.value[idx]);
SDL_snprintf(tmp, SDL_arraysize(tmp), "%02X", info->deviceId.value[idx]);
SDL_strlcat(elem->path, tmp, SDL_arraysize(elem->path));
}

Expand Down
Loading