Commit 6b07ec99 authored by Vinicius Jarina's avatar Vinicius Jarina
Browse files

Better MonoTouch support.

parent c4730b0c
......@@ -29,6 +29,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<DefineConstants>TRACE;LUA_CORE;_WIN32;LUA_COMPAT_VARARG;LUA_COMPAT_MOD;LUA_COMPAT_GFIND;CATCH_EXCEPTIONS</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
......
......@@ -153,10 +153,12 @@ namespace LuaInterface
if(luatype == LuaTypes.Function)
return extractValues[runtimeHandleValue];
}
#if !MONOTOUCH
else if(typeof(Delegate).IsAssignableFrom(paramType) && luatype == LuaTypes.Function)
return new ExtractValue(new DelegateGenerator(translator, paramType).extractGenerated);
else if(paramType.IsInterface && luatype == LuaTypes.Table)
return new ExtractValue(new ClassGenerator(translator, paramType).extractGenerated);
#endif
else if((paramType.IsInterface || paramType.IsClass) && luatype == LuaTypes.Nil)
{
// kevinh - allow nil to be silently converted to null - extractNetObject will return null when the item ain't found
......
......@@ -65,16 +65,18 @@ namespace LuaInterface
private CodeGeneration()
{
#if MONOTOUCH
throw new NotImplementedException (" Emit not available on MonoTouch ");
#else
// Create an assembly name
assemblyName = new AssemblyName();
assemblyName.Name = "LuaInterface_generatedcode";
// Create a new assembly with one module.
#if !MONOTOUCH
newAssembly = Thread.GetDomain().DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
newModule = newAssembly.DefineDynamicModule("LuaInterface_generatedcode");
#endif
}
/*
......
......@@ -29,6 +29,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<DefineConstants>MONOTOUCH</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment