summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-02-06 16:10:36 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2018-02-08 10:49:47 -0300
commit17b9f00f7eb70547a8c325a9b057ad36606a6a8b (patch)
tree24cb7f4454ccd823dce605c7abe6a88b7d83b3a9
parent22794846f4da918333d375d21aabbc67e63b78eb (diff)
eina_mono: Avoid calling eina_init directly from the modules.
They must be initialized from the eina.Config.Init() method.
-rw-r--r--src/bindings/mono/eina_mono/eina_error.cs6
-rw-r--r--src/bindings/mono/eina_mono/eina_log.cs9
2 files changed, 2 insertions, 13 deletions
diff --git a/src/bindings/mono/eina_mono/eina_error.cs b/src/bindings/mono/eina_mono/eina_error.cs
index c83728047e..58495aa904 100644
--- a/src/bindings/mono/eina_mono/eina_error.cs
+++ b/src/bindings/mono/eina_mono/eina_error.cs
@@ -38,15 +38,11 @@ public struct Error : IComparable<Error>
38 return "eina.Error(" + code + ")"; 38 return "eina.Error(" + code + ")";
39 } 39 }
40 40
41 public static void Init() 41 internal static void Init()
42 { 42 {
43 if (eina_init() == 0)
44 throw (new efl.EflException("Failed to init Eina"));
45
46 EFL_ERROR = eina_error_msg_register("Managed Code Error"); 43 EFL_ERROR = eina_error_msg_register("Managed Code Error");
47 } 44 }
48 45
49 [DllImport(efl.Libs.Eina)] private static extern int eina_init();
50 [DllImport(efl.Libs.Eina)] static extern Error eina_error_msg_register(string msg); 46 [DllImport(efl.Libs.Eina)] static extern Error eina_error_msg_register(string msg);
51 [DllImport(efl.Libs.Eina)] static extern Error eina_error_get(); 47 [DllImport(efl.Libs.Eina)] static extern Error eina_error_get();
52 [DllImport(efl.Libs.Eina)] static extern void eina_error_set(Error error); 48 [DllImport(efl.Libs.Eina)] static extern void eina_error_set(Error error);
diff --git a/src/bindings/mono/eina_mono/eina_log.cs b/src/bindings/mono/eina_mono/eina_log.cs
index 747f8ec58c..c5e456c3a6 100644
--- a/src/bindings/mono/eina_mono/eina_log.cs
+++ b/src/bindings/mono/eina_mono/eina_log.cs
@@ -9,8 +9,6 @@ namespace eina { // Manual wrappers around eina functions
9 9
10public class Log 10public class Log
11{ 11{
12 [DllImport(efl.Libs.Eina)] private static extern int eina_init();
13
14 [DllImport(efl.Libs.Eina)] private static extern void eina_log_print( 12 [DllImport(efl.Libs.Eina)] private static extern void eina_log_print(
15 int domain, 13 int domain,
16 Level level, 14 Level level,
@@ -55,16 +53,11 @@ public class Log
55 53
56 private static int domain = -1; 54 private static int domain = -1;
57 55
58 public static void Init(String name="mono", String color="\033[32;1m") 56 internal static void Init(String name="mono", String color="\033[32;1m")
59 { 57 {
60 if (domain == -1) 58 if (domain == -1)
61 { 59 {
62 // Maybe move this check outside when other eina stuff get support? 60 // Maybe move this check outside when other eina stuff get support?
63 if (eina_init() == 0)
64 {
65 Console.WriteLine("Error: Can't initialize Eina for logging.");
66 return;
67 }
68 domain = eina_log_domain_register(name, color); 61 domain = eina_log_domain_register(name, color);
69 if (domain < 0) 62 if (domain < 0)
70 Console.WriteLine("Error: Couldn't register Eina log domain for name {0}.", name); 63 Console.WriteLine("Error: Couldn't register Eina log domain for name {0}.", name);