Narrow constraint on generic GetDelegateForFunctionPointer ext. method

This commit is contained in:
YoshiRulz 2021-03-26 14:51:45 +10:00
parent cbd875376e
commit fabf518c73
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 2 additions and 4 deletions

View File

@ -48,10 +48,8 @@ namespace BizHawk.BizInvoke
public static class CallingConventionAdapterExtensions
{
public static T GetDelegateForFunctionPointer<T>(this ICallingConventionAdapter a, IntPtr p)
where T : class
{
return (T)(object)a.GetDelegateForFunctionPointer(p, typeof(T));
}
where T : Delegate
=> (T) a.GetDelegateForFunctionPointer(p, typeof(T));
}
public class ParameterInfo