* Type.cs: Updated list of non CLS-compliant types.

* Parameter.cs: Changed [In] and [Out] attributes to [InAttribute] and
  [OutAttribute] to work around strange gmcs 2.0 bug.
This commit is contained in:
the_fiddler 2009-08-12 10:11:41 +00:00
parent 04e8dc3472
commit a495ca8c7c
2 changed files with 23 additions and 3 deletions

View file

@ -224,9 +224,9 @@ namespace Bind.Structures
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if (Flow == FlowDirection.Out) if (Flow == FlowDirection.Out)
sb.Append("[Out] "); sb.Append("[OutAttribute] ");
else if (Flow == FlowDirection.Undefined) else if (Flow == FlowDirection.Undefined)
sb.Append("[In, Out] "); sb.Append("[InAttribute, OutAttribute] ");
if (Reference) if (Reference)
{ {

View file

@ -180,7 +180,26 @@ namespace Bind.Structures
{ {
get get
{ {
bool compliant = !(CurrentType.Contains("UInt") || CurrentType.Contains("SByte")); bool compliant = true;
switch (CurrentType.ToLower())
{
case "sbyte":
case "ushort":
case "uint":
case "ulong":
case "uintptr":
compliant = false;
break;
default:
compliant = Pointer == 0;
break;
}
return compliant;
/*
if (Pointer != 0) if (Pointer != 0)
{ {
compliant &= CurrentType.Contains("IntPtr"); // IntPtr's are CLSCompliant. compliant &= CurrentType.Contains("IntPtr"); // IntPtr's are CLSCompliant.
@ -188,6 +207,7 @@ namespace Bind.Structures
compliant |= (Settings.Compatibility & Settings.Legacy.NoPublicUnsafeFunctions) != Settings.Legacy.None; compliant |= (Settings.Compatibility & Settings.Legacy.NoPublicUnsafeFunctions) != Settings.Legacy.None;
} }
return compliant; return compliant;
*/
//return compliant && (!Pointer || CurrentType.Contains("IntPtr")); //return compliant && (!Pointer || CurrentType.Contains("IntPtr"));
//return compliant && !(Pointer && ((Settings.Compatibility & Settings.Legacy.NoPublicUnsafeFunctions) == Settings.Legacy.None)); //return compliant && !(Pointer && ((Settings.Compatibility & Settings.Legacy.NoPublicUnsafeFunctions) == Settings.Legacy.None));