Merge pull request #4444 from lateralusX/jlorenss/windows-unwind-info
[mono.git] / mcs / tools / resx2sr / resx2sr.cs
index e27838e42d01f450876e4579adbc2ce3a9c0c6ba..935a31ecc323b492256337f89b269b6d5b5a3cee 100644 (file)
@@ -101,14 +101,28 @@ public class Program
 
                        str.WriteLine ("partial class SR");
                        str.WriteLine ("{");
+
+                       var dict = new Dictionary<string, string> ();
+
                        foreach (var entry in txtStrings) {
-                               str.Write ($"\tpublic const string {entry.Item1} = \"{ToCSharpString (entry.Item2)}\";");
+
+                               var value = ToCSharpString (entry.Item2);
+                               string found;
+                               if (dict.TryGetValue (entry.Item1, out found)) {
+                                       if (found == value)
+                                               continue;
+
+                                       str.WriteLine ($"\t// Constant value mismatch");
+                               } else {
+                                       dict.Add (entry.Item1, value);
+                               }
+
+                               str.Write ($"\tpublic const string {entry.Item1} = \"{value}\";");
 
                                if (!string.IsNullOrEmpty (entry.Item3))
                                        str.Write (" // {entry.Item3}");
 
                                str.WriteLine ();
-
                        }
                        str.WriteLine ("}");
                }