Files
BepInEx/BepInEx.IL2CPP/MonoExtensions.cs
T
2021-01-23 22:04:11 +02:00

23 lines
702 B
C#

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace BepInEx
{
/// <summary>
/// Contains unofficial extensions to the underlying Mono runtime.
/// </summary>
public static class MonoExtensions
{
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern IntPtr GetFunctionPointerForDelegateInternal2(Delegate d, CallingConvention conv);
public static IntPtr GetFunctionPointerForDelegate(Delegate d, CallingConvention conv)
{
if (d == null) throw new ArgumentNullException(nameof(d));
return GetFunctionPointerForDelegateInternal2(d, conv);
}
}
}