diff options
author | Jan <climblinne@users.noreply.github.com> | 2019-09-26 21:46:16 +0300 |
---|---|---|
committer | monojenkins <jo.shields+jenkins@xamarin.com> | 2019-09-26 21:46:16 +0300 |
commit | 3132cbd98b4856353b5004271d60ef5ca961dbd1 (patch) | |
tree | 614a4a89c1b98d5fba4e43964835c7eac458305e /samples | |
parent | 470e53f6b446f6adabb0ce4164b8540b9f65f09d (diff) |
Add loading the default Mono configuration file. (#16961)
Add loading the default Mono configuration file.
Add loading the default Mono configuration file in the examples of Mono Embedded.
Also include header in existing usage of `mono_config_parse`.
This fixes problems under Raspbian, when extending the sample with your own code.
The `teste.c` is still not compiling, because the `mono_set_allocator_vtable` function is not up to date. But I was not able to find the documentation for this function.
Diffstat (limited to 'samples')
-rw-r--r-- | samples/embed/test-invoke.c | 10 | ||||
-rw-r--r-- | samples/embed/teste.c | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/samples/embed/test-invoke.c b/samples/embed/test-invoke.c index 9d537169575..791c8afffb7 100644 --- a/samples/embed/test-invoke.c +++ b/samples/embed/test-invoke.c @@ -3,6 +3,7 @@ #include <mono/metadata/environment.h> #include <mono/metadata/assembly.h> #include <mono/metadata/debug-helpers.h> +#include <mono/metadata/mono-config.h> #include <string.h> #include <stdlib.h> @@ -327,7 +328,14 @@ main (int argc, char* argv[]) { return 1; } file = argv [1]; - /* + + /* + * Load the default Mono configuration file, this is needed + * if you are planning on using the dllmaps defined on the + * system configuration + */ + mono_config_parse (NULL); + /* * mono_jit_init() creates a domain: each assembly is * loaded and run in a MonoDomain. */ diff --git a/samples/embed/teste.c b/samples/embed/teste.c index 6f727a00e1b..9821997a7f5 100644 --- a/samples/embed/teste.c +++ b/samples/embed/teste.c @@ -1,6 +1,7 @@ #include <mono/jit/jit.h> #include <mono/metadata/environment.h> #include <mono/utils/mono-publib.h> +#include <mono/metadata/mono-config.h> #include <stdlib.h> /* |