Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ILRuntime/Runtime/CLRBinding/BindingCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public static void GenerateBindingCode(List<Type> types, string outputPath,
StringBuilder sb = new StringBuilder();
sb.Append(@"using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;

Expand Down Expand Up @@ -94,7 +95,7 @@ public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
sb.AppendLine(methodDef);
if (hasFieldCode)
sb.AppendLine(fieldDef);
if (hasMethodCode || hasFieldCode || hasCtorCode)
if (hasMethodCode || hasCtorCode)
sb.AppendLine(argsDef);
if (hasMethodCode || hasFieldCode || hasValueTypeCode || hasMiscCode || hasCtorCode)
sb.AppendLine(typeDef);
Expand Down Expand Up @@ -270,7 +271,7 @@ public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
sb.AppendLine(methodDef);
if (hasFieldCode)
sb.AppendLine(fieldDef);
if (hasMethodCode || hasFieldCode || hasCtorCode)
if (hasMethodCode || hasCtorCode)
sb.AppendLine(argsDef);
if (hasMethodCode || hasFieldCode || hasValueTypeCode || hasMiscCode || hasCtorCode)
sb.AppendLine(typeDef);
Expand Down Expand Up @@ -755,7 +756,7 @@ public static void Initialize(ILRuntime.Runtime.Enviorment.AppDomain app)
}
}

if (valueTypeBinders != null)
if (valueTypeBinders != null && valueTypeBinders.Count>0)
{
sb.AppendLine();

Expand Down