diff options
author | Sergey Geyn <Sergey.Geyn@gmail.com> | 2013-09-18 18:46:56 +0400 |
---|---|---|
committer | sergey.geyn <devnull@localhost> | 2013-09-18 18:46:56 +0400 |
commit | 4a04773b5b5bee08e497ae9deaf26bc2e71bf6dd (patch) | |
tree | f7cb0535433f21e79c24d906c7661c5975b1fb73 | |
parent | d63096d1b20d298d46c1ba217f45eda727d1c5fe (diff) | |
download | protobuf-4a04773b5b5bee08e497ae9deaf26bc2e71bf6dd.tar.gz protobuf-4a04773b5b5bee08e497ae9deaf26bc2e71bf6dd.tar.bz2 protobuf-4a04773b5b5bee08e497ae9deaf26bc2e71bf6dd.zip |
fixed a bug in protogen causing
"CSC : fatal error CS1647: An expression is too long or complex to compile"
when building auto-generated code
-rw-r--r-- | src/ProtoGen/UmbrellaClassGenerator.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ProtoGen/UmbrellaClassGenerator.cs b/src/ProtoGen/UmbrellaClassGenerator.cs index ef41be5d..bc0f1657 100644 --- a/src/ProtoGen/UmbrellaClassGenerator.cs +++ b/src/ProtoGen/UmbrellaClassGenerator.cs @@ -143,6 +143,7 @@ namespace Google.ProtocolBuffers.ProtoGen writer.WriteLine("#region Designer generated code");
writer.WriteLine();
+ writer.WriteLine("using System;");
writer.WriteLine("using pb = global::Google.ProtocolBuffers;");
writer.WriteLine("using pbc = global::Google.ProtocolBuffers.Collections;");
writer.WriteLine("using pbd = global::Google.ProtocolBuffers.Descriptors;");
@@ -206,16 +207,17 @@ namespace Google.ProtocolBuffers.ProtoGen writer.WriteLine("byte[] descriptorData = global::System.Convert.FromBase64String(");
writer.Indent();
writer.Indent();
-
+ writer.WriteLine("String.Concat(");
// TODO(jonskeet): Consider a C#-escaping format here instead of just Base64.
byte[] bytes = Descriptor.Proto.ToByteArray();
string base64 = Convert.ToBase64String(bytes);
while (base64.Length > 60)
{
- writer.WriteLine("\"{0}\" + ", base64.Substring(0, 60));
+ writer.WriteLine("\"{0}\" , ", base64.Substring(0, 60));
base64 = base64.Substring(60);
}
+ writer.WriteLine("\"{0}\") );", base64);
writer.WriteLine("\"{0}\");", base64);
writer.Outdent();
writer.Outdent();
|