|
@@ -54,17 +54,6 @@
|
|
#include "main/main.h"
|
|
#include "main/main.h"
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-#ifdef MONO_PRINT_HANDLER_ENABLED
|
|
|
|
-void gdmono_MonoPrintCallback(const char *string, mono_bool is_stdout) {
|
|
|
|
-
|
|
|
|
- if (is_stdout) {
|
|
|
|
- OS::get_singleton()->print(string);
|
|
|
|
- } else {
|
|
|
|
- OS::get_singleton()->printerr(string);
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
GDMono *GDMono::singleton = NULL;
|
|
GDMono *GDMono::singleton = NULL;
|
|
|
|
|
|
namespace {
|
|
namespace {
|
|
@@ -162,11 +151,6 @@ void GDMono::initialize() {
|
|
|
|
|
|
GDMonoLog::get_singleton()->initialize();
|
|
GDMonoLog::get_singleton()->initialize();
|
|
|
|
|
|
-#ifdef MONO_PRINT_HANDLER_ENABLED
|
|
|
|
- mono_trace_set_print_handler(gdmono_MonoPrintCallback);
|
|
|
|
- mono_trace_set_printerr_handler(gdmono_MonoPrintCallback);
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
String assembly_rootdir;
|
|
String assembly_rootdir;
|
|
String config_dir;
|
|
String config_dir;
|
|
|
|
|
|
@@ -327,7 +311,7 @@ namespace GodotSharpBindings {
|
|
uint64_t get_core_api_hash();
|
|
uint64_t get_core_api_hash();
|
|
#ifdef TOOLS_ENABLED
|
|
#ifdef TOOLS_ENABLED
|
|
uint64_t get_editor_api_hash();
|
|
uint64_t get_editor_api_hash();
|
|
-#endif // TOOLS_ENABLED
|
|
|
|
|
|
+#endif
|
|
uint32_t get_bindings_version();
|
|
uint32_t get_bindings_version();
|
|
|
|
|
|
void register_generated_icalls();
|
|
void register_generated_icalls();
|
|
@@ -344,29 +328,20 @@ void GDMono::_register_internal_calls() {
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|
|
-#ifdef DEBUG_METHODS_ENABLED
|
|
|
|
void GDMono::_initialize_and_check_api_hashes() {
|
|
void GDMono::_initialize_and_check_api_hashes() {
|
|
|
|
|
|
- api_core_hash = ClassDB::get_api_hash(ClassDB::API_CORE);
|
|
|
|
-
|
|
|
|
#ifdef MONO_GLUE_ENABLED
|
|
#ifdef MONO_GLUE_ENABLED
|
|
- if (api_core_hash != GodotSharpBindings::get_core_api_hash()) {
|
|
|
|
|
|
+ if (get_api_core_hash() != GodotSharpBindings::get_core_api_hash()) {
|
|
ERR_PRINT("Mono: Core API hash mismatch!");
|
|
ERR_PRINT("Mono: Core API hash mismatch!");
|
|
}
|
|
}
|
|
-#endif
|
|
|
|
|
|
|
|
#ifdef TOOLS_ENABLED
|
|
#ifdef TOOLS_ENABLED
|
|
- api_editor_hash = ClassDB::get_api_hash(ClassDB::API_EDITOR);
|
|
|
|
-
|
|
|
|
-#ifdef MONO_GLUE_ENABLED
|
|
|
|
- if (api_editor_hash != GodotSharpBindings::get_editor_api_hash()) {
|
|
|
|
|
|
+ if (get_api_editor_hash() != GodotSharpBindings::get_editor_api_hash()) {
|
|
ERR_PRINT("Mono: Editor API hash mismatch!");
|
|
ERR_PRINT("Mono: Editor API hash mismatch!");
|
|
}
|
|
}
|
|
-#endif
|
|
|
|
-
|
|
|
|
#endif // TOOLS_ENABLED
|
|
#endif // TOOLS_ENABLED
|
|
|
|
+#endif // MONO_GLUE_ENABLED
|
|
}
|
|
}
|
|
-#endif // DEBUG_METHODS_ENABLED
|
|
|
|
|
|
|
|
void GDMono::add_assembly(uint32_t p_domain_id, GDMonoAssembly *p_assembly) {
|
|
void GDMono::add_assembly(uint32_t p_domain_id, GDMonoAssembly *p_assembly) {
|
|
|
|
|
|
@@ -915,7 +890,7 @@ void GDMono::unhandled_exception_hook(MonoObject *p_exc, void *) {
|
|
ScriptDebugger::get_singleton()->idle_poll();
|
|
ScriptDebugger::get_singleton()->idle_poll();
|
|
#endif
|
|
#endif
|
|
abort();
|
|
abort();
|
|
- _UNREACHABLE_();
|
|
|
|
|
|
+ GD_UNREACHABLE();
|
|
}
|
|
}
|
|
|
|
|
|
GDMono::GDMono() {
|
|
GDMono::GDMono() {
|
|
@@ -946,12 +921,10 @@ GDMono::GDMono() {
|
|
editor_tools_assembly = NULL;
|
|
editor_tools_assembly = NULL;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-#ifdef DEBUG_METHODS_ENABLED
|
|
|
|
api_core_hash = 0;
|
|
api_core_hash = 0;
|
|
#ifdef TOOLS_ENABLED
|
|
#ifdef TOOLS_ENABLED
|
|
api_editor_hash = 0;
|
|
api_editor_hash = 0;
|
|
#endif
|
|
#endif
|
|
-#endif
|
|
|
|
}
|
|
}
|
|
|
|
|
|
GDMono::~GDMono() {
|
|
GDMono::~GDMono() {
|
|
@@ -1074,17 +1047,9 @@ void _GodotSharp::_bind_methods() {
|
|
_GodotSharp::_GodotSharp() {
|
|
_GodotSharp::_GodotSharp() {
|
|
|
|
|
|
singleton = this;
|
|
singleton = this;
|
|
- queue_empty = true;
|
|
|
|
-#ifndef NO_THREADS
|
|
|
|
- queue_mutex = Mutex::create();
|
|
|
|
-#endif
|
|
|
|
}
|
|
}
|
|
|
|
|
|
_GodotSharp::~_GodotSharp() {
|
|
_GodotSharp::~_GodotSharp() {
|
|
|
|
|
|
singleton = NULL;
|
|
singleton = NULL;
|
|
-
|
|
|
|
- if (queue_mutex) {
|
|
|
|
- memdelete(queue_mutex);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|