aboutsummaryrefslogtreecommitdiff
path: root/drivers/unix
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/unix')
-rw-r--r--drivers/unix/os_unix.cpp25
-rw-r--r--drivers/unix/os_unix.h4
2 files changed, 13 insertions, 16 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index 75f40cacc..e42459088 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -50,10 +50,10 @@
#include <mach-o/dyld.h>
#endif
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/param.h>
#endif
-#include "global_config.h"
+#include "project_settings.h"
#include <assert.h>
#include <dlfcn.h>
#include <errno.h>
@@ -453,7 +453,7 @@ Error OS_Unix::close_dynamic_library(void *p_library_handle) {
return OK;
}
-Error OS_Unix::get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle) {
+Error OS_Unix::get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional) {
const char *error;
dlerror(); // Clear existing errors
@@ -461,8 +461,12 @@ Error OS_Unix::get_dynamic_library_symbol_handle(void *p_library_handle, const S
error = dlerror();
if (error != NULL) {
- ERR_EXPLAIN("Can't resolve symbol " + p_name + ". Error: " + error);
- ERR_FAIL_V(ERR_CANT_RESOLVE);
+ if (!p_optional) {
+ ERR_EXPLAIN("Can't resolve symbol " + p_name + ". Error: " + error);
+ ERR_FAIL_V(ERR_CANT_RESOLVE);
+ } else {
+ return ERR_CANT_RESOLVE;
+ }
}
return OK;
}
@@ -494,7 +498,7 @@ String OS_Unix::get_data_dir() const {
if (has_environment("HOME")) {
- bool use_godot = GlobalConfig::get_singleton()->get("application/use_shared_user_dir");
+ bool use_godot = ProjectSettings::get_singleton()->get("application/config/use_shared_user_dir");
if (use_godot)
return get_environment("HOME") + "/.godot/app_userdata/" + an;
else
@@ -502,12 +506,7 @@ String OS_Unix::get_data_dir() const {
}
}
- return GlobalConfig::get_singleton()->get_resource_path();
-}
-
-bool OS_Unix::check_feature_support(const String &p_feature) {
-
- return VisualServer::get_singleton()->has_os_feature(p_feature);
+ return ProjectSettings::get_singleton()->get_resource_path();
}
String OS_Unix::get_installed_templates_path() const {
@@ -532,7 +531,7 @@ String OS_Unix::get_executable_path() const {
return OS::get_executable_path();
}
return b;
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
char resolved_path[MAXPATHLEN];
realpath(OS::get_executable_path().utf8().get_data(), resolved_path);
diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h
index 67eb5cefd..fdc6d6e28 100644
--- a/drivers/unix/os_unix.h
+++ b/drivers/unix/os_unix.h
@@ -85,7 +85,7 @@ public:
virtual Error open_dynamic_library(const String p_path, void *&p_library_handle);
virtual Error close_dynamic_library(void *p_library_handle);
- virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle);
+ virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false);
virtual Error set_cwd(const String &p_cwd);
@@ -117,8 +117,6 @@ public:
virtual String get_executable_path() const;
virtual String get_data_dir() const;
- virtual bool check_feature_support(const String &p_feature);
-
//virtual void run( MainLoop * p_main_loop );
};