Skip to content

Commit

Permalink
Fixup obsolete fragment values of -1, and rather allow giving a fallb…
Browse files Browse the repository at this point in the history
…ack fragment value.
  • Loading branch information
belkiss committed Oct 9, 2020
1 parent 4437a8c commit 3dd5c9d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Sharpmake/Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -640,13 +640,16 @@ internal void Initialize(Type targetType)
if (enumFields[j].Attributes.HasFlag(FieldAttributes.SpecialName))
continue;

if (enumFields[j].GetCustomAttribute<ObsoleteAttribute>() != 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,
Expand Down

0 comments on commit 3dd5c9d

Please sign in to comment.