Path: blob/master/thirdparty/sdl/patches/0005-fix-libudev-dbus.patch
9898 views
diff --git a/thirdparty/sdl/core/linux/SDL_dbus.c b/thirdparty/sdl/core/linux/SDL_dbus.c1index 9a2fc1ea531..9dc5c266732 1006442--- a/thirdparty/sdl/core/linux/SDL_dbus.c3+++ b/thirdparty/sdl/core/linux/SDL_dbus.c4@@ -97,15 +97,18 @@ static bool LoadDBUSSyms(void)56static void UnloadDBUSLibrary(void)7{8+#ifdef SOWRAP_ENABLED // Godot build system constant9if (dbus_handle) {10SDL_UnloadObject(dbus_handle);11dbus_handle = NULL;12}13+#endif14}1516static bool LoadDBUSLibrary(void)17{18bool result = true;19+#ifdef SOWRAP_ENABLED // Godot build system constant20if (!dbus_handle) {21dbus_handle = SDL_LoadObject(dbus_library);22if (!dbus_handle) {23@@ -118,6 +121,9 @@ static bool LoadDBUSLibrary(void)24}25}26}27+#else28+ result = LoadDBUSSyms();29+#endif30return result;31}3233diff --git a/thirdparty/sdl/core/linux/SDL_udev.c b/thirdparty/sdl/core/linux/SDL_udev.c34index 907c34c7f66..fbf2ff04440 10064435--- a/thirdparty/sdl/core/linux/SDL_udev.c36+++ b/thirdparty/sdl/core/linux/SDL_udev.c37@@ -38,7 +38,8 @@3839static const char *SDL_UDEV_LIBS[] = { "libudev.so.1", "libudev.so.0" };4041-static SDL_UDEV_PrivateData *_this = NULL;42+SDL_UDEV_PrivateData *SDL_UDEV_PrivateData_this = NULL;43+#define _this SDL_UDEV_PrivateData_this4445static bool SDL_UDEV_load_sym(const char *fn, void **addr);46static bool SDL_UDEV_load_syms(void);47diff --git a/thirdparty/sdl/core/linux/SDL_udev.h b/thirdparty/sdl/core/linux/SDL_udev.h48index 738f4bafe3f..50bed36248e 10064449--- a/thirdparty/sdl/core/linux/SDL_udev.h50+++ b/thirdparty/sdl/core/linux/SDL_udev.h51@@ -30,7 +30,8 @@52#define SDL_USE_LIBUDEV 153#endif5455-#include <libudev.h>56+//#include <libudev.h>57+#include "thirdparty/linuxbsd_headers/udev/libudev.h"58#include <sys/time.h>59#include <sys/types.h>6061diff --git a/thirdparty/sdl/hidapi/linux/hid.c b/thirdparty/sdl/hidapi/linux/hid.c62index dbbb3277854..51a32ef892f 10064463--- a/thirdparty/sdl/hidapi/linux/hid.c64+++ b/thirdparty/sdl/hidapi/linux/hid.c65@@ -40,7 +40,37 @@66#include <linux/hidraw.h>67#include <linux/version.h>68#include <linux/input.h>69-#include <libudev.h>70+//#include <libudev.h>71+#include "SDL_udev.h"72+extern SDL_UDEV_PrivateData *SDL_UDEV_PrivateData_this;73+#define udev_device_get_action (SDL_UDEV_PrivateData_this->syms.udev_device_get_action)74+#define udev_device_get_devnode (SDL_UDEV_PrivateData_this->syms.udev_device_get_devnode)75+#define udev_device_get_syspath (SDL_UDEV_PrivateData_this->syms.udev_device_get_syspath)76+#define udev_device_get_subsystem (SDL_UDEV_PrivateData_this->syms.udev_device_get_subsystem)77+#define udev_device_get_parent_with_subsystem_devtype (SDL_UDEV_PrivateData_this->syms.udev_device_get_parent_with_subsystem_devtype)78+#define udev_device_get_property_value (SDL_UDEV_PrivateData_this->syms.udev_device_get_property_value)79+#define udev_device_get_sysattr_value (SDL_UDEV_PrivateData_this->syms.udev_device_get_sysattr_value)80+#define udev_device_new_from_syspath (SDL_UDEV_PrivateData_this->syms.udev_device_new_from_syspath)81+#define udev_device_unref (SDL_UDEV_PrivateData_this->syms.udev_device_unref)82+#define udev_enumerate_add_match_property (SDL_UDEV_PrivateData_this->syms.udev_enumerate_add_match_property)83+#define udev_enumerate_add_match_subsystem (SDL_UDEV_PrivateData_this->syms.udev_enumerate_add_match_subsystem)84+#define udev_enumerate_get_list_entry (SDL_UDEV_PrivateData_this->syms.udev_enumerate_get_list_entry)85+#define udev_enumerate_new (SDL_UDEV_PrivateData_this->syms.udev_enumerate_new)86+#define udev_enumerate_scan_devices (SDL_UDEV_PrivateData_this->syms.udev_enumerate_scan_devices)87+#define udev_enumerate_unref (SDL_UDEV_PrivateData_this->syms.udev_enumerate_unref)88+#define udev_list_entry_get_name (SDL_UDEV_PrivateData_this->syms.udev_list_entry_get_name)89+#define udev_list_entry_get_next (SDL_UDEV_PrivateData_this->syms.udev_list_entry_get_next)90+#define udev_monitor_enable_receiving (SDL_UDEV_PrivateData_this->syms.udev_monitor_enable_receiving)91+#define udev_monitor_filter_add_match_subsystem_devtype (SDL_UDEV_PrivateData_this->syms.udev_monitor_filter_add_match_subsystem_devtype)92+#define udev_monitor_get_fd (SDL_UDEV_PrivateData_this->syms.udev_monitor_get_fd)93+#define udev_monitor_new_from_netlink (SDL_UDEV_PrivateData_this->syms.udev_monitor_new_from_netlink)94+#define udev_monitor_receive_device (SDL_UDEV_PrivateData_this->syms.udev_monitor_receive_device)95+#define udev_monitor_unref (SDL_UDEV_PrivateData_this->syms.udev_monitor_unref)96+#define udev_new (SDL_UDEV_PrivateData_this->syms.udev_new)97+#define udev_unref (SDL_UDEV_PrivateData_this->syms.udev_unref)98+#define udev_device_new_from_devnum (SDL_UDEV_PrivateData_this->syms.udev_device_new_from_devnum)99+#define udev_device_get_devnum (SDL_UDEV_PrivateData_this->syms.udev_device_get_devnum)100+#undef SDL_UDEV_SYM101102#include "../hidapi/hidapi.h"103104diff --git a/thirdparty/sdl/loadso/dlopen/SDL_sysloadso.c b/thirdparty/sdl/loadso/dlopen/SDL_sysloadso.c105index c84d1a1b5f9..e09c09080cd 100644106--- a/thirdparty/sdl/loadso/dlopen/SDL_sysloadso.c107+++ b/thirdparty/sdl/loadso/dlopen/SDL_sysloadso.c108@@ -65,8 +65,8 @@ SDL_FunctionPointer SDL_LoadFunction(SDL_SharedObject *handle, const char *name)109symbol = dlsym(handle, _name);110SDL_small_free(_name, isstack);111if (!symbol) {112- SDL_SetError("Failed loading %s: %s", name,113- (const char *)dlerror());114+ //SDL_SetError("Failed loading %s: %s", name,115+ // (const char *)dlerror());116}117}118return symbol;119120121