Skip to content

Commit 7dd65f7

Browse files
monojenkinsluhenry
authored andcommitted
[mono-api-html] Render something for fields with marshalling info. (#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[]" />
1 parent 7c89827 commit 7dd65f7

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎mcs/tools/mono-api-html/FieldComparer.cs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ void RenderFieldAttributes (FieldAttributes source, FieldAttributes target, ApiC
5656
change.AppendAdded ("[NonSerialized]\n");
5757
}
5858
}
59+
60+
var srcHasFieldMarshal = (source & FieldAttributes.HasFieldMarshal) != 0;
61+
var tgtHasFieldMarshal = (target & FieldAttributes.HasFieldMarshal) != 0;
62+
if (srcHasFieldMarshal != tgtHasFieldMarshal) {
63+
// this is not a breaking change, so only render it if it changed.
64+
if (srcHasFieldMarshal) {
65+
change.AppendRemoved ("[MarshalAs]", false);
66+
} else {
67+
change.AppendAdded ("[MarshalAs]", false);
68+
}
69+
change.Append (Environment.NewLine);
70+
}
5971
}
6072

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

0 commit comments

Comments
 (0)