diff --git a/src/Generator.Rewrite/Program.cs b/src/Generator.Rewrite/Program.cs index 12977590..621b610f 100644 --- a/src/Generator.Rewrite/Program.cs +++ b/src/Generator.Rewrite/Program.cs @@ -45,7 +45,7 @@ namespace OpenTK.Rewrite var file = args[0]; var key = args[1]; var options = args.Where(a => a.StartsWith("-") || a.StartsWith("/")); - program.Rewrite(file, key, options); + program.Rewrite(file, key, options.ToList()); } // mscorlib types @@ -61,7 +61,7 @@ namespace OpenTK.Rewrite static bool dllimport; - void Rewrite(string file, string keyfile, IEnumerable options) + void Rewrite(string file, string keyfile, List options) { dllimport = options.Contains("-dllimport"); @@ -80,6 +80,7 @@ namespace OpenTK.Rewrite { provider = new Mono.Cecil.Mdb.MdbReaderProvider(); } + read_params.SymbolReaderProvider = provider; read_params.ReadSymbols = true; read_params.ReadWrite = true; @@ -154,7 +155,7 @@ namespace OpenTK.Rewrite } } - void Rewrite(TypeDefinition type, IEnumerable options) + void Rewrite(TypeDefinition type, List options) { var entry_points = type.Fields.FirstOrDefault(f => f.Name == "EntryPoints"); if (entry_points != null) @@ -196,7 +197,7 @@ namespace OpenTK.Rewrite } void Rewrite(TypeDefinition type, FieldDefinition entry_points, - List entry_signatures, IEnumerable options) + List entry_signatures, List options) { // Rewrite all wrapper methods var wrapper_signatures = new List(); @@ -206,8 +207,8 @@ namespace OpenTK.Rewrite foreach (var wrapper in wrapper_signatures) { var autogenerated = wrapper.CustomAttributes - .Where(a => a.AttributeType.Name == "AutoGeneratedAttribute"); - if (autogenerated.Count() > 0) + .Where(a => a.AttributeType.Name == "AutoGeneratedAttribute").ToList(); + if (autogenerated.Any()) { var signature_name = (string)autogenerated.First() .Fields.First(f => f.Name == "EntryPoint").Argument.Value; @@ -258,7 +259,7 @@ namespace OpenTK.Rewrite // Create body for method static void ProcessMethod(MethodDefinition wrapper, MethodDefinition native, int slot, - FieldDefinition entry_points, IEnumerable options) + FieldDefinition entry_points, List options) { var body = wrapper.Body; var il = body.GetILProcessor();