diff options
| author | Thomas Herzog | 2017-11-20 11:11:54 +0100 |
|---|---|---|
| committer | GitHub | 2017-11-20 11:11:54 +0100 |
| commit | 90e37d58d55d5e8b79b3edc6167c3db94a4c423e (patch) | |
| tree | 954927b92883da9b34f3deca271dd927ce26e61f /modules/gdnative/gdnative.cpp | |
| parent | 341bf71dc17f8c4a84291b89a78ecc2936d85378 (diff) | |
| parent | 33ffdba553e90471150bd84067c88a79e874a2aa (diff) | |
| download | godot-90e37d58d55d5e8b79b3edc6167c3db94a4c423e.tar.gz godot-90e37d58d55d5e8b79b3edc6167c3db94a4c423e.tar.zst godot-90e37d58d55d5e8b79b3edc6167c3db94a4c423e.zip | |
Merge pull request #13060 from karroffel/gdnative-version-error
[GDNative] (version-) error reporting + small API change
Diffstat (limited to '')
| -rw-r--r-- | modules/gdnative/gdnative.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index 44d6dffc8..7949ca182 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -109,6 +109,9 @@ Ref<GDNativeLibrary> GDNative::get_library() { return library; } +extern "C" void _gdnative_report_version_mismatch(const godot_object *p_library, const char *p_ext, godot_gdnative_api_version p_want, godot_gdnative_api_version p_have); +extern "C" void _gdnative_report_loading_error(const godot_object *p_library, const char *p_what); + bool GDNative::initialize() { if (library.is_null()) { ERR_PRINT("No library set, can't initialize GDNative object"); @@ -168,6 +171,8 @@ bool GDNative::initialize() { options.core_api_hash = ClassDB::get_api_hash(ClassDB::API_CORE); options.editor_api_hash = ClassDB::get_api_hash(ClassDB::API_EDITOR); options.no_api_hash = ClassDB::get_api_hash(ClassDB::API_NONE); + options.report_version_mismatch = &_gdnative_report_version_mismatch; + options.report_loading_error = &_gdnative_report_loading_error; options.gd_native_library = (godot_object *)(get_library().ptr()); options.active_library_path = (godot_string *)&path; |
