From 3dd5c9d887363766450e7c29480914c3f079719e Mon Sep 17 00:00:00 2001 From: Lambert Clara Date: Fri, 9 Oct 2020 15:49:41 +0200 Subject: [PATCH] Fixup obsolete fragment values of -1, and rather allow giving a fallback fragment value. --- Sharpmake/Target.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Sharpmake/Target.cs b/Sharpmake/Target.cs index d6d20a26d..2d294e5c1 100644 --- a/Sharpmake/Target.cs +++ b/Sharpmake/Target.cs @@ -140,9 +140,9 @@ public enum OutputType public enum DotNetFramework { [Obsolete("Please use at least .net framework 3.5.", error: false)] - v2 = -1, + v2 = v3_5, [Obsolete("Please use at least .net framework 3.5.", error: false)] - v3 = -1, + v3 = v3_5, v3_5 = 1 << 0, v3_5clientprofile = 1 << 1, @@ -640,13 +640,16 @@ internal void Initialize(Type targetType) if (enumFields[j].Attributes.HasFlag(FieldAttributes.SpecialName)) continue; + if (enumFields[j].GetCustomAttribute() != null) + continue; + if (i != j) { int jEnumFieldValue = (int)enumFields[j].GetRawConstantValue(); if (enumFieldValue == jEnumFieldValue) { - throw new Error("2 enum field with he same value found in {0} fragment: {1}={2} and {3}={4}", + throw new Error("2 enum fields with the same value found in {0} fragment: {1}={2} and {3}={4}", enumType.FullName, enumFields[i].Name, enumFieldValue,