1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-22 15:58:52 -05:00

Ensure JNA 4.x compatibility (i.e. use JNA package on Linux)

This commit is contained in:
Reinhard Pointner 2019-05-14 18:49:58 +07:00
parent dc80f2d9fc
commit f3308493f7
4 changed files with 9 additions and 3 deletions

View File

@ -16,8 +16,13 @@ interface MediaInfoLibrary extends Library {
// libmediainfo for linux depends on libzen, so we need to load dependencies first, because we know where our native libs are (e.g. Java Web Start Cache). // libmediainfo for linux depends on libzen, so we need to load dependencies first, because we know where our native libs are (e.g. Java Web Start Cache).
// if we do not, the system will look for dependencies, but only in the library path // if we do not, the system will look for dependencies, but only in the library path
// Ensure JNA 4.x compatibility (i.e. use JNA package on Linux)
@SuppressWarnings("deprecation")
Library LIB_ZEN = Platform.isLinux() ? (Library) Native.loadLibrary("zen", Library.class) : null; Library LIB_ZEN = Platform.isLinux() ? (Library) Native.loadLibrary("zen", Library.class) : null;
// Ensure JNA 4.x compatibility (i.e. use JNA package on Linux)
@SuppressWarnings("deprecation")
MediaInfoLibrary INSTANCE = (MediaInfoLibrary) Native.loadLibrary("mediainfo", MediaInfoLibrary.class, singletonMap(OPTION_FUNCTION_MAPPER, new FunctionMapper() { MediaInfoLibrary INSTANCE = (MediaInfoLibrary) Native.loadLibrary("mediainfo", MediaInfoLibrary.class, singletonMap(OPTION_FUNCTION_MAPPER, new FunctionMapper() {
@Override @Override

View File

@ -8,6 +8,8 @@ import com.sun.jna.Pointer;
public class NativeGVFS implements GVFS { public class NativeGVFS implements GVFS {
// Ensure JNA 4.x compatibility (i.e. use JNA package on Linux)
@SuppressWarnings("deprecation")
private static final LibGIO lib_gio = (LibGIO) Native.loadLibrary("gio-2.0", LibGIO.class); private static final LibGIO lib_gio = (LibGIO) Native.loadLibrary("gio-2.0", LibGIO.class);
private static final Pointer gvfs = lib_gio.g_vfs_get_default(); private static final Pointer gvfs = lib_gio.g_vfs_get_default();

View File

@ -6,8 +6,7 @@ import com.sun.jna.Pointer;
public interface XAttr extends Library { public interface XAttr extends Library {
// load from current image XAttr INSTANCE = Native.load(null, XAttr.class);
XAttr INSTANCE = Native.loadLibrary(null, XAttr.class);
// see /usr/include/sys/xattr.h // see /usr/include/sys/xattr.h
int XATTR_NOFOLLOW = 0x0001; int XATTR_NOFOLLOW = 0x0001;

View File

@ -9,7 +9,7 @@ import com.sun.jna.win32.W32APIOptions;
public interface Kernel32 extends StdCallLibrary { public interface Kernel32 extends StdCallLibrary {
Kernel32 INSTANCE = Native.loadLibrary("kernel32", Kernel32.class, W32APIOptions.DEFAULT_OPTIONS); Kernel32 INSTANCE = Native.load("kernel32", Kernel32.class, W32APIOptions.DEFAULT_OPTIONS);
long APPMODEL_ERROR_NO_PACKAGE = 15700; long APPMODEL_ERROR_NO_PACKAGE = 15700;
long ERROR_INSUFFICIENT_BUFFER = 122; long ERROR_INSUFFICIENT_BUFFER = 122;