From df19b9340877b8e49cdc4728a62c64f5f93c811f Mon Sep 17 00:00:00 2001 From: "Anthony J. Bentley" Date: Mon, 9 Oct 2017 03:41:17 -0600 Subject: Include POSIX headers required for fd_set and INADDR_ANY. --- src/libui_sdl/Platform.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libui_sdl/Platform.cpp b/src/libui_sdl/Platform.cpp index 0b1e0a2..1d7438b 100644 --- a/src/libui_sdl/Platform.cpp +++ b/src/libui_sdl/Platform.cpp @@ -32,6 +32,8 @@ #else #include #include + #include + #include #include #define socket_t int #define sockaddr_t struct sockaddr -- cgit v1.2.3 From c992177edabd604160458e255b07d7b23f3f1a85 Mon Sep 17 00:00:00 2001 From: "Anthony J. Bentley" Date: Mon, 9 Oct 2017 03:42:35 -0600 Subject: Only link against libdl on Linux. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2076d30..d824f6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,8 +82,10 @@ if (UNIX) LINK_LIBRARIES(${GTK3_LIBRARIES}) ADD_DEFINITIONS(${GTK3_CFLAGS_OTHER}) - - LINK_LIBRARIES("dl") + + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + LINK_LIBRARIES("dl") + endif () endif (UNIX) find_package(SDL2 REQUIRED) -- cgit v1.2.3 From 56bf1ecc131fa7f0cd152dfaee7fe9c5917d4b40 Mon Sep 17 00:00:00 2001 From: "Anthony J. Bentley" Date: Mon, 9 Oct 2017 03:42:50 -0600 Subject: Treat failed haptics initialization as a warning, not a fatal error. --- src/libui_sdl/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index dceef64..7c6508c 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -567,7 +567,11 @@ int main(int argc, char** argv) // http://stackoverflow.com/questions/14543333/joystick-wont-work-using-sdl SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); - if (SDL_Init(SDL_INIT_EVERYTHING) < 0) + if (SDL_Init(SDL_INIT_HAPTIC) < 0) + { + printf("SDL couldn't init rumble\n"); + } + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK) < 0) { printf("SDL shat itself :(\n"); return 1; -- cgit v1.2.3