diff --git a/src/Generator.Rewrite/Program.cs b/src/Generator.Rewrite/Program.cs index 1a888d21..e161a988 100644 --- a/src/Generator.Rewrite/Program.cs +++ b/src/Generator.Rewrite/Program.cs @@ -302,7 +302,12 @@ namespace OpenTK.Rewrite generatedVariables = EmitConvenienceWrapper(wrapper, native, difference, body, il); } - if (slot != -1) + if (Options.UseDLLImport) + { + // issue DllImport call + EmitCall(il, native); + } + else { // push the entry point address on the stack EmitEntryPoint(entry_points, il, slot); @@ -310,11 +315,6 @@ namespace OpenTK.Rewrite // issue calli EmitCalli(il, native); } - else - { - // issue DllImport call - EmitCall(il, native); - } if (wrapper.ReturnType.Name != "Void") {