build: change <endian.h> header file and __s32 type for FreeBSD

This commit is contained in:
armin-25689 2023-12-31 15:26:58 +08:00 committed by Cameron Gutman
parent b3fb22d427
commit a610eddd97

View File

@ -38,7 +38,11 @@
#include <limits.h> #include <limits.h>
#include <unistd.h> #include <unistd.h>
#include <pthread.h> #include <pthread.h>
#ifdef __linux__
#include <endian.h> #include <endian.h>
#else
#include <sys/endian.h>
#endif
#include <math.h> #include <math.h>
#if __BYTE_ORDER == __LITTLE_ENDIAN #if __BYTE_ORDER == __LITTLE_ENDIAN
@ -66,8 +70,13 @@ struct input_device {
int hats_state[3][2]; int hats_state[3][2];
int fd; int fd;
char modifiers; char modifiers;
#ifdef __linux__
__s32 mouseDeltaX, mouseDeltaY, mouseVScroll, mouseHScroll; __s32 mouseDeltaX, mouseDeltaY, mouseVScroll, mouseHScroll;
__s32 touchDownX, touchDownY, touchX, touchY; __s32 touchDownX, touchDownY, touchX, touchY;
#else
int32_t mouseDeltaX, mouseDeltaY, mouseVScroll, mouseHScroll;
int32_t touchDownX, touchDownY, touchX, touchY;
#endif
struct timeval touchDownTime; struct timeval touchDownTime;
struct timeval btnDownTime; struct timeval btnDownTime;
short controllerId; short controllerId;