Skip to content

Commit

Permalink
ensure import Android dll methods only on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
amakropoulos committed Sep 8, 2024
1 parent f394ab4 commit cc78f4c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Runtime/LLMLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ private static class Win32
private static class Android
{
public static IntPtr dlopen(string path) => dlopen(path, 1);

#if UNITY_ANDROID
// LoadLibrary for Android
[DllImport("__Internal")]
public static extern IntPtr dlopen(string filename, int flags);
Expand All @@ -252,6 +254,23 @@ private static class Android
// FreeLibrary for Android
[DllImport("__Internal")]
public static extern int dlclose(IntPtr handle);
#else
public static IntPtr dlopen(string filename, int flags)
{
return default;
}

public static IntPtr dlsym(IntPtr handle, string symbol)
{
return default;
}

public static int dlclose(IntPtr handle)
{
return default;
}

#endif
}
}

Expand Down

0 comments on commit cc78f4c

Please sign in to comment.