Skip to content
0.2.0-dev Download ZIP
120 lines ·5.5 KB Raw
1diff --git a/thirdparty/sdl/core/linux/SDL_dbus.c b/thirdparty/sdl/core/linux/SDL_dbus.c
2index cd7f77a100..663e70427a 100644
3--- a/thirdparty/sdl/core/linux/SDL_dbus.c
4+++ b/thirdparty/sdl/core/linux/SDL_dbus.c
5@@ -115,15 +115,18 @@ static bool LoadDBUSSyms(void)
6
7 static void UnloadDBUSLibrary(void)
8 {
9+#ifdef SOWRAP_ENABLED // Godot build system constant
10 if (dbus_handle) {
11 SDL_UnloadObject(dbus_handle);
12 dbus_handle = NULL;
13 }
14+#endif
15 }
16
17 static bool LoadDBUSLibrary(void)
18 {
19 bool result = true;
20+#ifdef SOWRAP_ENABLED // Godot build system constant
21 if (!dbus_handle) {
22 dbus_handle = SDL_LoadObject(dbus_library);
23 if (!dbus_handle) {
24@@ -136,6 +139,9 @@ static bool LoadDBUSLibrary(void)
25 }
26 }
27 }
28+#else
29+ result = LoadDBUSSyms();
30+#endif
31 return result;
32 }
33
34diff --git a/thirdparty/sdl/core/linux/SDL_udev.c b/thirdparty/sdl/core/linux/SDL_udev.c
35index 3aaa0fb4e9..58b0b1ed42 100644
36--- a/thirdparty/sdl/core/linux/SDL_udev.c
37+++ b/thirdparty/sdl/core/linux/SDL_udev.c
38@@ -53,7 +53,9 @@ SDL_ELF_NOTE_DLOPEN(
39 SDL_UDEV_DLNOTE_LIBS
40 )
41
42-static SDL_UDEV_PrivateData *_this = NULL;
43+// static SDL_UDEV_PrivateData *_this = NULL;
44+SDL_UDEV_PrivateData *SDL_UDEV_PrivateData_this = NULL;
45+#define _this SDL_UDEV_PrivateData_this
46
47 static bool SDL_UDEV_load_sym(const char *fn, void **addr);
48 static bool SDL_UDEV_load_syms(void);
49diff --git a/thirdparty/sdl/core/linux/SDL_udev.h b/thirdparty/sdl/core/linux/SDL_udev.h
50index f2b1ce56e2..5958ba4f37 100644
51--- a/thirdparty/sdl/core/linux/SDL_udev.h
52+++ b/thirdparty/sdl/core/linux/SDL_udev.h
53@@ -30,7 +30,8 @@
54 #define SDL_USE_LIBUDEV 1
55 #endif
56
57-#include <libudev.h>
58+// #include <libudev.h>
59+#include <thirdparty/linuxbsd_headers/udev/libudev.h>
60 #include <linux/input.h>
61 #include <sys/time.h>
62 #include <sys/types.h>
63diff --git a/thirdparty/sdl/hidapi/linux/hid.c b/thirdparty/sdl/hidapi/linux/hid.c
64index c0cb6a7b0e..367b243830 100644
65--- a/thirdparty/sdl/hidapi/linux/hid.c
66+++ b/thirdparty/sdl/hidapi/linux/hid.c
67@@ -40,7 +40,37 @@
68 #include <linux/hidraw.h>
69 #include <linux/version.h>
70 #include <linux/input.h>
71-#include <libudev.h>
72+// #include <libudev.h>
73+#include "SDL_udev.h"
74+extern SDL_UDEV_PrivateData *SDL_UDEV_PrivateData_this;
75+#define udev_device_get_action (SDL_UDEV_PrivateData_this->syms.udev_device_get_action)
76+#define udev_device_get_devnode (SDL_UDEV_PrivateData_this->syms.udev_device_get_devnode)
77+#define udev_device_get_syspath (SDL_UDEV_PrivateData_this->syms.udev_device_get_syspath)
78+#define udev_device_get_subsystem (SDL_UDEV_PrivateData_this->syms.udev_device_get_subsystem)
79+#define udev_device_get_parent_with_subsystem_devtype (SDL_UDEV_PrivateData_this->syms.udev_device_get_parent_with_subsystem_devtype)
80+#define udev_device_get_property_value (SDL_UDEV_PrivateData_this->syms.udev_device_get_property_value)
81+#define udev_device_get_sysattr_value (SDL_UDEV_PrivateData_this->syms.udev_device_get_sysattr_value)
82+#define udev_device_new_from_syspath (SDL_UDEV_PrivateData_this->syms.udev_device_new_from_syspath)
83+#define udev_device_unref (SDL_UDEV_PrivateData_this->syms.udev_device_unref)
84+#define udev_enumerate_add_match_property (SDL_UDEV_PrivateData_this->syms.udev_enumerate_add_match_property)
85+#define udev_enumerate_add_match_subsystem (SDL_UDEV_PrivateData_this->syms.udev_enumerate_add_match_subsystem)
86+#define udev_enumerate_get_list_entry (SDL_UDEV_PrivateData_this->syms.udev_enumerate_get_list_entry)
87+#define udev_enumerate_new (SDL_UDEV_PrivateData_this->syms.udev_enumerate_new)
88+#define udev_enumerate_scan_devices (SDL_UDEV_PrivateData_this->syms.udev_enumerate_scan_devices)
89+#define udev_enumerate_unref (SDL_UDEV_PrivateData_this->syms.udev_enumerate_unref)
90+#define udev_list_entry_get_name (SDL_UDEV_PrivateData_this->syms.udev_list_entry_get_name)
91+#define udev_list_entry_get_next (SDL_UDEV_PrivateData_this->syms.udev_list_entry_get_next)
92+#define udev_monitor_enable_receiving (SDL_UDEV_PrivateData_this->syms.udev_monitor_enable_receiving)
93+#define udev_monitor_filter_add_match_subsystem_devtype (SDL_UDEV_PrivateData_this->syms.udev_monitor_filter_add_match_subsystem_devtype)
94+#define udev_monitor_get_fd (SDL_UDEV_PrivateData_this->syms.udev_monitor_get_fd)
95+#define udev_monitor_new_from_netlink (SDL_UDEV_PrivateData_this->syms.udev_monitor_new_from_netlink)
96+#define udev_monitor_receive_device (SDL_UDEV_PrivateData_this->syms.udev_monitor_receive_device)
97+#define udev_monitor_unref (SDL_UDEV_PrivateData_this->syms.udev_monitor_unref)
98+#define udev_new (SDL_UDEV_PrivateData_this->syms.udev_new)
99+#define udev_unref (SDL_UDEV_PrivateData_this->syms.udev_unref)
100+#define udev_device_new_from_devnum (SDL_UDEV_PrivateData_this->syms.udev_device_new_from_devnum)
101+#define udev_device_get_devnum (SDL_UDEV_PrivateData_this->syms.udev_device_get_devnum)
102+#undef SDL_UDEV_SYM
103
104 #include "../hidapi/hidapi.h"
105
106diff --git a/thirdparty/sdl/loadso/dlopen/SDL_sysloadso.c b/thirdparty/sdl/loadso/dlopen/SDL_sysloadso.c
107index 7d223ce75e..e45b5093f8 100644
108--- a/thirdparty/sdl/loadso/dlopen/SDL_sysloadso.c
109+++ b/thirdparty/sdl/loadso/dlopen/SDL_sysloadso.c
110@@ -65,8 +65,8 @@ SDL_FunctionPointer SDL_LoadFunction(SDL_SharedObject *handle, const char *name)
111 symbol = dlsym(handle, _name);
112 SDL_small_free(_name, isstack);
113 if (!symbol) {
114- SDL_SetError("Failed loading %s: %s", name,
115- (const char *)dlerror());
116+ // SDL_SetError("Failed loading %s: %s", name,
117+ // (const char *)dlerror());
118 }
119 }
120 return symbol;