1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

LibraryLoadCallback

This commit is contained in:
Brian Fiete 2025-01-17 10:16:03 -08:00
parent 2e40bab705
commit e478462487

View file

@ -234,8 +234,20 @@ namespace System
public static extern void BfDelegateTargetCheck(void* target);
[CallingConvention(.Cdecl), AlwaysInclude]
public static extern void* LoadSharedLibrary(char8* filePath);
[CallingConvention(.Cdecl), AlwaysInclude]
public static extern void LoadSharedLibraryInto(char8* filePath, void** libDest);
[AlwaysInclude, LinkName("Beef_LoadSharedLibraryInto")]
public static void LoadSharedLibraryInto(char8* filePath, void** libDest)
{
if (*libDest == null)
{
if (Runtime.LibraryLoadCallback != null)
*libDest = Runtime.LibraryLoadCallback(filePath);
}
if (*libDest == null)
{
*libDest = LoadSharedLibrary(filePath);
}
}
[CallingConvention(.Cdecl), AlwaysInclude]
public static extern void* GetSharedProcAddress(void* libHandle, char8* procName);
[CallingConvention(.Cdecl), AlwaysInclude]