mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-19 15:51:45 +00:00
23 lines
702 B
C#
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);
|
|
}
|
|
}
|
|
}
|