Merge pull request #15665 from endragor/fix-android-gdnative
Fix open_dynamic_library for Android
This commit is contained in:
commit
5f22422d99
platform/android
@ -48,6 +48,8 @@
|
|||||||
#include "file_access_jandroid.h"
|
#include "file_access_jandroid.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <dlfcn.h>
|
||||||
|
|
||||||
class AndroidLogger : public Logger {
|
class AndroidLogger : public Logger {
|
||||||
public:
|
public:
|
||||||
virtual void logv(const char *p_format, va_list p_list, bool p_err) {
|
virtual void logv(const char *p_format, va_list p_list, bool p_err) {
|
||||||
@ -173,6 +175,15 @@ void OS_Android::alert(const String &p_alert, const String &p_title) {
|
|||||||
alert_func(p_alert, p_title);
|
alert_func(p_alert, p_title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Error OS_Android::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) {
|
||||||
|
p_library_handle = dlopen(p_path.utf8().get_data(), RTLD_NOW);
|
||||||
|
if (!p_library_handle) {
|
||||||
|
ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + dlerror());
|
||||||
|
ERR_FAIL_V(ERR_CANT_OPEN);
|
||||||
|
}
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
void OS_Android::set_mouse_show(bool p_show) {
|
void OS_Android::set_mouse_show(bool p_show) {
|
||||||
|
|
||||||
//android has no mouse...
|
//android has no mouse...
|
||||||
|
@ -159,6 +159,8 @@ public:
|
|||||||
|
|
||||||
virtual void alert(const String &p_alert, const String &p_title = "ALERT!");
|
virtual void alert(const String &p_alert, const String &p_title = "ALERT!");
|
||||||
|
|
||||||
|
virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false);
|
||||||
|
|
||||||
virtual void set_mouse_show(bool p_show);
|
virtual void set_mouse_show(bool p_show);
|
||||||
virtual void set_mouse_grab(bool p_grab);
|
virtual void set_mouse_grab(bool p_grab);
|
||||||
virtual bool is_mouse_grab_enabled() const;
|
virtual bool is_mouse_grab_enabled() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user