Skip to content

Commit

Permalink
[mono-api-html] Render something for fields with marshalling info. (#…
Browse files Browse the repository at this point in the history
…10698)

Fixes this warning when comparing Xamarin.iOS.dll:

    Comparison resulting in no changes (src: Public, HasFieldMarshal dst: Public) :
    <field name="EdgeTessellationFactor" attrib="4102" fieldtype="System.UInt16[]" />
    <field name="EdgeTessellationFactor" attrib="6" fieldtype="System.UInt16[]" />
  • Loading branch information
monojenkins authored and luhenry committed Sep 19, 2018
1 parent 7c89827 commit 7dd65f7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mcs/tools/mono-api-html/FieldComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ void RenderFieldAttributes (FieldAttributes source, FieldAttributes target, ApiC
change.AppendAdded ("[NonSerialized]\n");
}
}

var srcHasFieldMarshal = (source & FieldAttributes.HasFieldMarshal) != 0;
var tgtHasFieldMarshal = (target & FieldAttributes.HasFieldMarshal) != 0;
if (srcHasFieldMarshal != tgtHasFieldMarshal) {
// this is not a breaking change, so only render it if it changed.
if (srcHasFieldMarshal) {
change.AppendRemoved ("[MarshalAs]", false);
} else {
change.AppendAdded ("[MarshalAs]", false);
}
change.Append (Environment.NewLine);
}
}

// the visibility values are the same for MethodAttributes and FieldAttributes, so just use the same method.
Expand Down

0 comments on commit 7dd65f7

Please sign in to comment.