diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/extension/gdextension.cpp | 8 | ||||
-rw-r--r-- | core/os/os.h | 9 |
2 files changed, 15 insertions, 2 deletions
diff --git a/core/extension/gdextension.cpp b/core/extension/gdextension.cpp index 1735ee51a4..abf4adbc0d 100644 --- a/core/extension/gdextension.cpp +++ b/core/extension/gdextension.cpp @@ -773,7 +773,13 @@ Error GDExtension::open_library(const String &p_path, const String &p_entry_symb } String actual_lib_path; - Error err = OS::get_singleton()->open_dynamic_library(abs_path, library, true, &actual_lib_path, Engine::get_singleton()->is_editor_hint(), &abs_dependencies_paths); + OS::GDExtensionData data = { + true, // also_set_library_path + &actual_lib_path, // r_resolved_path + Engine::get_singleton()->is_editor_hint(), // generate_temp_files + &abs_dependencies_paths, // library_dependencies + }; + Error err = OS::get_singleton()->open_dynamic_library(abs_path, library, &data); if (actual_lib_path.get_file() != abs_path.get_file()) { // If temporary files are generated, let's change the library path to point at the original, diff --git a/core/os/os.h b/core/os/os.h index cafd5cf6c4..069a3876af 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -153,7 +153,14 @@ public: 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, String *r_resolved_path = nullptr, bool p_generate_temp_files = false, PackedStringArray *p_library_dependencies = nullptr) { return ERR_UNAVAILABLE; } + struct GDExtensionData { + bool also_set_library_path = false; + String *r_resolved_path = nullptr; + bool generate_temp_files = false; + PackedStringArray *library_dependencies = nullptr; + }; + + virtual Error open_dynamic_library(const String &p_path, void *&p_library_handle, GDExtensionData *p_data = nullptr) { return ERR_UNAVAILABLE; } virtual Error close_dynamic_library(void *p_library_handle) { return ERR_UNAVAILABLE; } virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String &p_name, void *&p_symbol_handle, bool p_optional = false) { return ERR_UNAVAILABLE; } |