summaryrefslogtreecommitdiff
path: root/core/extension
diff options
context:
space:
mode:
Diffstat (limited to 'core/extension')
-rw-r--r--core/extension/extension_api_dump.cpp10
-rw-r--r--core/extension/native_extension.cpp7
2 files changed, 12 insertions, 5 deletions
diff --git a/core/extension/extension_api_dump.cpp b/core/extension/extension_api_dump.cpp
index 9e8addf8aa..edd48cf9cd 100644
--- a/core/extension/extension_api_dump.cpp
+++ b/core/extension/extension_api_dump.cpp
@@ -334,14 +334,14 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
{
// Global enums and constants.
Array constants;
- HashMap<String, List<Pair<String, int>>> enum_list;
+ HashMap<String, List<Pair<String, int64_t>>> enum_list;
for (int i = 0; i < CoreConstants::get_global_constant_count(); i++) {
- int value = CoreConstants::get_global_constant_value(i);
+ int64_t value = CoreConstants::get_global_constant_value(i);
String enum_name = CoreConstants::get_global_constant_enum(i);
String name = CoreConstants::get_global_constant_name(i);
if (!enum_name.is_empty()) {
- enum_list[enum_name].push_back(Pair<String, int>(name, value));
+ enum_list[enum_name].push_back(Pair<String, int64_t>(name, value));
} else {
Dictionary d;
d["name"] = name;
@@ -353,11 +353,11 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
api_dump["global_constants"] = constants;
Array enums;
- for (const KeyValue<String, List<Pair<String, int>>> &E : enum_list) {
+ for (const KeyValue<String, List<Pair<String, int64_t>>> &E : enum_list) {
Dictionary d1;
d1["name"] = E.key;
Array values;
- for (const Pair<String, int> &F : E.value) {
+ for (const Pair<String, int64_t> &F : E.value) {
Dictionary d2;
d2["name"] = F.first;
d2["value"] = F.second;
diff --git a/core/extension/native_extension.cpp b/core/extension/native_extension.cpp
index ac9d2ca8a6..ebdfa20725 100644
--- a/core/extension/native_extension.cpp
+++ b/core/extension/native_extension.cpp
@@ -281,6 +281,7 @@ void NativeExtension::_get_library_path(const GDNativeExtensionClassLibraryPtr p
Error NativeExtension::open_library(const String &p_path, const String &p_entry_symbol) {
Error err = OS::get_singleton()->open_dynamic_library(p_path, library, true, &library_path);
if (err != OK) {
+ ERR_PRINT("GDExtension dynamic library not found: " + p_path);
return err;
}
@@ -289,6 +290,7 @@ Error NativeExtension::open_library(const String &p_path, const String &p_entry_
err = OS::get_singleton()->get_dynamic_library_symbol_handle(library, p_entry_symbol, entry_funcptr, false);
if (err != OK) {
+ ERR_PRINT("GDExtension entry point '" + p_entry_symbol + "' not found in library " + p_path);
OS::get_singleton()->close_dynamic_library(library);
return err;
}
@@ -299,6 +301,7 @@ Error NativeExtension::open_library(const String &p_path, const String &p_entry_
level_initialized = -1;
return OK;
} else {
+ ERR_PRINT("GDExtension initialization function '" + p_entry_symbol + "' returned an error.");
return FAILED;
}
}
@@ -387,6 +390,7 @@ Ref<Resource> NativeExtensionResourceLoader::load(const String &p_path, const St
}
if (err != OK) {
+ ERR_PRINT("Error loading GDExtension config file: " + p_path);
return Ref<Resource>();
}
@@ -394,6 +398,7 @@ Ref<Resource> NativeExtensionResourceLoader::load(const String &p_path, const St
if (r_error) {
*r_error = ERR_INVALID_DATA;
}
+ ERR_PRINT("GDExtension config file must contain 'configuration.entry_symbol' key: " + p_path);
return Ref<Resource>();
}
@@ -426,6 +431,7 @@ Ref<Resource> NativeExtensionResourceLoader::load(const String &p_path, const St
if (r_error) {
*r_error = ERR_FILE_NOT_FOUND;
}
+ ERR_PRINT("No GDExtension library found for current architecture; in config file " + p_path);
return Ref<Resource>();
}
@@ -443,6 +449,7 @@ Ref<Resource> NativeExtensionResourceLoader::load(const String &p_path, const St
}
if (err != OK) {
+ // Errors already logged in open_library()
return Ref<Resource>();
}