aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2015-02-07 15:32:03 -0600
committerrogerk <devnull@localhost>2015-02-07 15:32:03 -0600
commite234691b67fb62057dfa0d71196e508f230bfb5f (patch)
tree8600a04d7aaf072ef3dd41e8b3d7cdeb295e97e0
parent569212f38b3a14db1d417b70a4b6c2933a47bf85 (diff)
downloadprotobuf-e234691b67fb62057dfa0d71196e508f230bfb5f.tar.gz
protobuf-e234691b67fb62057dfa0d71196e508f230bfb5f.tar.bz2
protobuf-e234691b67fb62057dfa0d71196e508f230bfb5f.zip
Fix build error for missing class HashSet on some platforms
-rw-r--r--src/ProtoGen/Generator.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ProtoGen/Generator.cs b/src/ProtoGen/Generator.cs
index 91ca5c23..bc481ec0 100644
--- a/src/ProtoGen/Generator.cs
+++ b/src/ProtoGen/Generator.cs
@@ -89,7 +89,12 @@ namespace Google.ProtocolBuffers.ProtoGen
names.Add(file, true);
}
- var filesToGenerate = new HashSet<string>(request.FileToGenerateList);
+ //ROK - Changed to dictionary from HashSet to allow 2.0 compile
+ var filesToGenerate = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
+ foreach (var item in request.FileToGenerateList)
+ {
+ filesToGenerate[item] = null;
+ }
foreach (FileDescriptor descriptor in descriptors)
{
// Optionally exclude descriptors in google.protobuf
@@ -97,7 +102,7 @@ namespace Google.ProtocolBuffers.ProtoGen
{
continue;
}
- if (filesToGenerate.Contains(descriptor.Name))
+ if (filesToGenerate.ContainsKey(descriptor.Name))
{
Generate(descriptor, duplicates, response);
}