diff --git a/CMakeLists.txt b/CMakeLists.txt index bd9a1f84f2..d1a96350d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1470,12 +1470,14 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) file(GLOB CORE_UNIX_SOURCES ${SDL3_SOURCE_DIR}/src/core/unix/*.c) list(APPEND SOURCE_FILES ${CORE_UNIX_SOURCES}) - check_c_source_compiles(" - #include - #ifndef EVIOCGNAME - #error EVIOCGNAME() ioctl not available - #endif - int main(int argc, char** argv) { return 0; }" HAVE_INPUT_EVENTS) + if (HAVE_LINUX_INPUT_H) + check_c_source_compiles(" + #include + #ifndef EVIOCGNAME + #error EVIOCGNAME() ioctl not available + #endif + int main(int argc, char** argv) { return 0; }" HAVE_INPUT_EVENTS) + endif() if(LINUX) check_c_source_compiles(" diff --git a/src/SDL_log.c b/src/SDL_log.c index 9a407fd72c..bdd0cd30ad 100644 --- a/src/SDL_log.c +++ b/src/SDL_log.c @@ -496,6 +496,11 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, #if HAVE_STDIO_H && \ !(defined(__APPLE__) && (defined(SDL_VIDEO_DRIVER_COCOA) || defined(SDL_VIDEO_DRIVER_UIKIT))) fprintf(stderr, "%s: %s\n", SDL_priority_prefixes[priority], message); +#else + /* We won't print anything, but reference the priority prefix anyway + to avoid a compiler warning. + */ + (void)SDL_priority_prefixes[priority]; #endif } diff --git a/src/filesystem/unix/SDL_sysfilesystem.c b/src/filesystem/unix/SDL_sysfilesystem.c index f128eb09fc..16d4f0a640 100644 --- a/src/filesystem/unix/SDL_sysfilesystem.c +++ b/src/filesystem/unix/SDL_sysfilesystem.c @@ -25,14 +25,14 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ -#include -#include -#include -#include #include #include -#include +#include #include +#include +#include +#include +#include #if defined(__FREEBSD__) || defined(__OPENBSD__) #include diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c index 5e8483c647..5357bfcdb6 100644 --- a/src/hidapi/SDL_hidapi.c +++ b/src/hidapi/SDL_hidapi.c @@ -63,7 +63,8 @@ #ifdef HAVE_INOTIFY #include /* just in case we didn't use that SDL_USE_LIBUDEV block... */ -#include /* errno, strerror */ +#include /* strerror */ +#include /* errno */ #include #include /* For the definition of NAME_MAX */ #include