diff options
author | Karroffel <therzog@mail.de> | 2017-03-08 03:59:12 +0100 |
---|---|---|
committer | Karroffel <therzog@mail.de> | 2017-04-03 16:10:26 +0200 |
commit | 67f59bc2d9e2ce5faa9507017d49827753981e1e (patch) | |
tree | fafe196f28cbacb89d93fcd65666fb66416309c3 /drivers/unix | |
parent | 2281942fb3ac5889abc6e95df27a80e71fe32c0e (diff) |
increased maximum number of scripting languages
Diffstat (limited to 'drivers/unix')
-rw-r--r-- | drivers/unix/os_unix.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 999e20621b..6e0674d060 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -436,30 +436,31 @@ String OS_Unix::get_locale() const { return locale; } -Error OS_Unix::open_dynamic_library(const String p_path, void* &p_library_handle) { +Error OS_Unix::open_dynamic_library(const String p_path, void *&p_library_handle) { p_library_handle = dlopen(p_path.utf8().get_data(), RTLD_NOW); - if(!p_library_handle) { + if (!p_library_handle) { ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + dlerror()); ERR_FAIL_V(ERR_CANT_OPEN); } return OK; } -Error OS_Unix::close_dynamic_library(void* p_library_handle) { - if(dlclose(p_library_handle)) { +Error OS_Unix::close_dynamic_library(void *p_library_handle) { + if (dlclose(p_library_handle)) { return FAILED; } return OK; } -Error OS_Unix::get_dynamic_library_symbol_handle(void* p_library_handle, const String p_name, void* &p_symbol_handle) { - char* error; +Error OS_Unix::get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle) { + char *error; dlerror(); // Clear existing errors p_symbol_handle = dlsym(p_library_handle, p_name.utf8().get_data()); - if ((error = dlerror()) != NULL) { - ERR_EXPLAIN("Can't resolve symbol " + p_name + ". Error: " + dlerror()); + error = dlerror(); + if (error != NULL) { + ERR_EXPLAIN("Can't resolve symbol " + p_name + ". Error: " + error); ERR_FAIL_V(ERR_CANT_RESOLVE); } return OK; |