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

Better MonoTouch support.

parent c4730b0c
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause> <ConsolePause>False</ConsolePause>
<DefineConstants>TRACE;LUA_CORE;_WIN32;LUA_COMPAT_VARARG;LUA_COMPAT_MOD;LUA_COMPAT_GFIND;CATCH_EXCEPTIONS</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
......
...@@ -153,10 +153,12 @@ namespace LuaInterface ...@@ -153,10 +153,12 @@ namespace LuaInterface
if(luatype == LuaTypes.Function) if(luatype == LuaTypes.Function)
return extractValues[runtimeHandleValue]; return extractValues[runtimeHandleValue];
} }
#if !MONOTOUCH
else if(typeof(Delegate).IsAssignableFrom(paramType) && luatype == LuaTypes.Function) else if(typeof(Delegate).IsAssignableFrom(paramType) && luatype == LuaTypes.Function)
return new ExtractValue(new DelegateGenerator(translator, paramType).extractGenerated); return new ExtractValue(new DelegateGenerator(translator, paramType).extractGenerated);
else if(paramType.IsInterface && luatype == LuaTypes.Table) else if(paramType.IsInterface && luatype == LuaTypes.Table)
return new ExtractValue(new ClassGenerator(translator, paramType).extractGenerated); return new ExtractValue(new ClassGenerator(translator, paramType).extractGenerated);
#endif
else if((paramType.IsInterface || paramType.IsClass) && luatype == LuaTypes.Nil) 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 // 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 ...@@ -65,16 +65,18 @@ namespace LuaInterface
private CodeGeneration() private CodeGeneration()
{ {
#if MONOTOUCH
throw new NotImplementedException (" Emit not available on MonoTouch ");
#else
// Create an assembly name // Create an assembly name
assemblyName = new AssemblyName(); assemblyName = new AssemblyName();
assemblyName.Name = "LuaInterface_generatedcode"; assemblyName.Name = "LuaInterface_generatedcode";
// Create a new assembly with one module. // Create a new assembly with one module.
#if !MONOTOUCH
newAssembly = Thread.GetDomain().DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); newAssembly = Thread.GetDomain().DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
newModule = newAssembly.DefineDynamicModule("LuaInterface_generatedcode"); newModule = newAssembly.DefineDynamicModule("LuaInterface_generatedcode");
#endif #endif
} }
/* /*
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause> <ConsolePause>False</ConsolePause>
<DefineConstants>MONOTOUCH</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <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