mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-05 15:03:43 +00:00
Fixed some warnings when building on Linux with -DSDL_LIBC=OFF
This commit is contained in:
parent
e9014ee769
commit
bde808cd87
4 changed files with 20 additions and 12 deletions
|
@ -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)
|
file(GLOB CORE_UNIX_SOURCES ${SDL3_SOURCE_DIR}/src/core/unix/*.c)
|
||||||
list(APPEND SOURCE_FILES ${CORE_UNIX_SOURCES})
|
list(APPEND SOURCE_FILES ${CORE_UNIX_SOURCES})
|
||||||
|
|
||||||
check_c_source_compiles("
|
if (HAVE_LINUX_INPUT_H)
|
||||||
#include <linux/input.h>
|
check_c_source_compiles("
|
||||||
#ifndef EVIOCGNAME
|
#include <linux/input.h>
|
||||||
#error EVIOCGNAME() ioctl not available
|
#ifndef EVIOCGNAME
|
||||||
#endif
|
#error EVIOCGNAME() ioctl not available
|
||||||
int main(int argc, char** argv) { return 0; }" HAVE_INPUT_EVENTS)
|
#endif
|
||||||
|
int main(int argc, char** argv) { return 0; }" HAVE_INPUT_EVENTS)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(LINUX)
|
if(LINUX)
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
|
|
|
@ -496,6 +496,11 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
|
||||||
#if HAVE_STDIO_H && \
|
#if HAVE_STDIO_H && \
|
||||||
!(defined(__APPLE__) && (defined(SDL_VIDEO_DRIVER_COCOA) || defined(SDL_VIDEO_DRIVER_UIKIT)))
|
!(defined(__APPLE__) && (defined(SDL_VIDEO_DRIVER_COCOA) || defined(SDL_VIDEO_DRIVER_UIKIT)))
|
||||||
fprintf(stderr, "%s: %s\n", SDL_priority_prefixes[priority], message);
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,14 +25,14 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
/* System dependent filesystem routines */
|
/* System dependent filesystem routines */
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <limits.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#if defined(__FREEBSD__) || defined(__OPENBSD__)
|
#if defined(__FREEBSD__) || defined(__OPENBSD__)
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
|
|
|
@ -63,7 +63,8 @@
|
||||||
|
|
||||||
#ifdef HAVE_INOTIFY
|
#ifdef HAVE_INOTIFY
|
||||||
#include <unistd.h> /* just in case we didn't use that SDL_USE_LIBUDEV block... */
|
#include <unistd.h> /* just in case we didn't use that SDL_USE_LIBUDEV block... */
|
||||||
#include <errno.h> /* errno, strerror */
|
#include <string.h> /* strerror */
|
||||||
|
#include <errno.h> /* errno */
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <limits.h> /* For the definition of NAME_MAX */
|
#include <limits.h> /* For the definition of NAME_MAX */
|
||||||
#include <sys/inotify.h>
|
#include <sys/inotify.h>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue