Merge pull request #97120 from raulsntos/dotnet/fix-mono-char-ptrs

C#: Use `char *` with CoreCLR/MonoVM APIs
This commit is contained in:
Rémi Verschelde 2024-09-17 21:01:29 +02:00
commit ffd6788e63
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -464,8 +464,8 @@ godot_plugins_initialize_fn initialize_coreclr_and_godot_plugins(bool &r_runtime
String assembly_name = path::get_csharp_project_name(); String assembly_name = path::get_csharp_project_name();
String tpa_list = make_tpa_list(); String tpa_list = make_tpa_list();
const char *prop_keys[] = { HOSTFXR_STR("TRUSTED_PLATFORM_ASSEMBLIES") }; const char *prop_keys[] = { "TRUSTED_PLATFORM_ASSEMBLIES" };
const char *prop_values[] = { get_data(str_to_hostfxr(tpa_list)) }; const char *prop_values[] = { tpa_list.utf8().get_data() };
int nprops = sizeof(prop_keys) / sizeof(prop_keys[0]); int nprops = sizeof(prop_keys) / sizeof(prop_keys[0]);
void *coreclr_handle = nullptr; void *coreclr_handle = nullptr;
@ -478,9 +478,9 @@ godot_plugins_initialize_fn initialize_coreclr_and_godot_plugins(bool &r_runtime
print_verbose(".NET: CoreCLR initialized"); print_verbose(".NET: CoreCLR initialized");
coreclr_create_delegate(coreclr_handle, domain_id, coreclr_create_delegate(coreclr_handle, domain_id,
get_data(str_to_hostfxr(assembly_name)), assembly_name.utf8().get_data(),
HOSTFXR_STR("GodotPlugins.Game.Main"), "GodotPlugins.Game.Main",
HOSTFXR_STR("InitializeFromGameProject"), "InitializeFromGameProject",
(void **)&godot_plugins_initialize); (void **)&godot_plugins_initialize);
ERR_FAIL_NULL_V_MSG(godot_plugins_initialize, nullptr, ".NET: Failed to get GodotPlugins initialization function pointer"); ERR_FAIL_NULL_V_MSG(godot_plugins_initialize, nullptr, ".NET: Failed to get GodotPlugins initialization function pointer");