forked from enlightenment/efl
eina_mono: Avoid calling eina_init directly from the modules.
They must be initialized from the eina.Config.Init() method.
This commit is contained in:
parent
22794846f4
commit
17b9f00f7e
|
@ -38,15 +38,11 @@ public struct Error : IComparable<Error>
|
|||
return "eina.Error(" + code + ")";
|
||||
}
|
||||
|
||||
public static void Init()
|
||||
internal static void Init()
|
||||
{
|
||||
if (eina_init() == 0)
|
||||
throw (new efl.EflException("Failed to init Eina"));
|
||||
|
||||
EFL_ERROR = eina_error_msg_register("Managed Code Error");
|
||||
}
|
||||
|
||||
[DllImport(efl.Libs.Eina)] private static extern int eina_init();
|
||||
[DllImport(efl.Libs.Eina)] static extern Error eina_error_msg_register(string msg);
|
||||
[DllImport(efl.Libs.Eina)] static extern Error eina_error_get();
|
||||
[DllImport(efl.Libs.Eina)] static extern void eina_error_set(Error error);
|
||||
|
|
|
@ -9,8 +9,6 @@ namespace eina { // Manual wrappers around eina functions
|
|||
|
||||
public class Log
|
||||
{
|
||||
[DllImport(efl.Libs.Eina)] private static extern int eina_init();
|
||||
|
||||
[DllImport(efl.Libs.Eina)] private static extern void eina_log_print(
|
||||
int domain,
|
||||
Level level,
|
||||
|
@ -55,16 +53,11 @@ public class Log
|
|||
|
||||
private static int domain = -1;
|
||||
|
||||
public static void Init(String name="mono", String color="\033[32;1m")
|
||||
internal static void Init(String name="mono", String color="\033[32;1m")
|
||||
{
|
||||
if (domain == -1)
|
||||
{
|
||||
// Maybe move this check outside when other eina stuff get support?
|
||||
if (eina_init() == 0)
|
||||
{
|
||||
Console.WriteLine("Error: Can't initialize Eina for logging.");
|
||||
return;
|
||||
}
|
||||
domain = eina_log_domain_register(name, color);
|
||||
if (domain < 0)
|
||||
Console.WriteLine("Error: Couldn't register Eina log domain for name {0}.", name);
|
||||
|
|
Loading…
Reference in New Issue