Fixed building without linux/input.h

https://github.com/libsdl-org/SDL/issues/6169
This commit is contained in:
Sam Lantinga
2022-11-11 10:24:17 -08:00
parent b7e65a81f1
commit 9f8b68a278
12 changed files with 39 additions and 19 deletions

View File

@@ -19,10 +19,12 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#include "SDL_evdev_capabilities.h"
#if HAVE_LIBUDEV_H || defined(SDL_JOYSTICK_LINUX)
#if HAVE_LINUX_INPUT_H
/* missing defines in older Linux kernel headers */
#ifndef BTN_TRIGGER_HAPPY
@@ -142,4 +144,6 @@ SDL_EVDEV_GuessDeviceClass(unsigned long bitmask_ev[NBITS(EV_MAX)],
return devclass;
}
#endif
#endif /* HAVE_LINUX_INPUT_H */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -19,12 +19,13 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#ifndef SDL_evdev_capabilities_h_
#define SDL_evdev_capabilities_h_
#if HAVE_LINUX_INPUT_H
#include <linux/input.h>
/* A device can be any combination of these classes */
@@ -51,6 +52,8 @@ extern int SDL_EVDEV_GuessDeviceClass(unsigned long bitmask_ev[NBITS(EV_MAX)],
unsigned long bitmask_key[NBITS(KEY_MAX)],
unsigned long bitmask_rel[NBITS(REL_MAX)]);
#endif /* HAVE_LINUX_INPUT_H */
#endif /* SDL_evdev_capabilities_h_ */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -18,6 +18,7 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#include "SDL_ime.h"
#include "SDL_ibus.h"

View File

@@ -19,9 +19,8 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#include "SDL_sandbox.h"
#include <unistd.h>

View File

@@ -18,6 +18,7 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
/*
* To list the properties of a device, try something like:

View File

@@ -24,7 +24,7 @@
#ifndef SDL_udev_h_
#define SDL_udev_h_
#if HAVE_LIBUDEV_H
#if HAVE_LIBUDEV_H && HAVE_LINUX_INPUT_H
#ifndef SDL_USE_LIBUDEV
#define SDL_USE_LIBUDEV 1
@@ -108,7 +108,7 @@ extern const SDL_UDEV_Symbols *SDL_UDEV_GetUdevSyms(void);
extern void SDL_UDEV_ReleaseUdevSyms(void);
#endif /* HAVE_LIBUDEV_H */
#endif /* HAVE_LIBUDEV_H && HAVE_LINUX_INPUT_H */
#endif /* SDL_udev_h_ */