mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 01:15:26 +00:00
[Bind] Use byte for GLboolean return types
GLboolean is typedefed as an unsigned char. It appears that `[return: MarshalAs(UnmanagedType.U1)]` is ignored in calli p/invokes, so we need to take care of this ourselves by emitting byte instead of bool for the p/invoke signature. The public API remains unchanged. Fixes issue #129.
This commit is contained in:
parent
d81fc0ee10
commit
92efb5957f
|
@ -588,6 +588,12 @@ namespace Bind
|
|||
d.ReturnType.QualifiedType = "int";
|
||||
}
|
||||
|
||||
if (d.ReturnType.CurrentType.ToLower().Contains("bool"))
|
||||
{
|
||||
d.ReturnType.QualifiedType = "byte";
|
||||
d.ReturnType.WrapperType |= WrapperTypes.BoolParameter;
|
||||
}
|
||||
|
||||
d.ReturnType.CurrentType = GetCLSCompliantType(d.ReturnType);
|
||||
}
|
||||
|
||||
|
@ -1212,6 +1218,11 @@ namespace Bind
|
|||
// Nothing else we can do, using generics will break the runtime
|
||||
func.ReturnType.QualifiedType = "IntPtr";
|
||||
}
|
||||
|
||||
if ((func.ReturnType.WrapperType & WrapperTypes.BoolParameter) != 0)
|
||||
{
|
||||
func.ReturnType.QualifiedType = "bool";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
Loading…
Reference in a new issue