forked from focus-creative-games/il2cpp_plus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibraryLoader.cpp
More file actions
35 lines (28 loc) · 1.07 KB
/
LibraryLoader.cpp
File metadata and controls
35 lines (28 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "os/c-api/il2cpp-config-platforms.h"
#if !RUNTIME_TINY
#include "os/c-api/LibraryLoader-c-api.h"
#include "os/LibraryLoader.h"
#include "utils/StringUtils.h"
#include "utils/StringViewUtils.h"
extern "C"
{
void* UnityPalLibraryLoaderLoadDynamicLibrary(const char* nativeDynamicLibrary, int flags)
{
Il2CppNativeString libName(il2cpp::utils::StringUtils::Utf8ToNativeString(nativeDynamicLibrary));
return il2cpp::os::LibraryLoader::LoadDynamicLibrary(STRING_TO_STRINGVIEW(libName), flags);
}
void UnityPalLibraryLoaderCleanupLoadedLibraries()
{
il2cpp::os::LibraryLoader::CleanupLoadedLibraries();
}
UnityPalMethodPointer UnityPalLibraryLoaderGetFunctionPointer(void* dynamicLibrary, const char* functionName)
{
return il2cpp::os::LibraryLoader::GetFunctionPointer(dynamicLibrary, functionName);
}
int32_t UnityPalLibraryLoaderCloseLoadedLibrary(void** dynamicLibrary)
{
IL2CPP_ASSERT(*dynamicLibrary);
return il2cpp::os::LibraryLoader::CloseLoadedLibrary(*dynamicLibrary);
}
}
#endif