mirror of
https://github.com/shadowfacts/jinput-arm64.git
synced 2025-12-06 08:01:59 +01:00
Rather than crashing, just disable the plugin if we an't load the dll
This commit is contained in:
parent
69a2984615
commit
0015c724b3
|
|
@ -70,11 +70,16 @@ public final class OSXEnvironmentPlugin extends ControllerEnvironment implements
|
||||||
AccessController.doPrivileged(
|
AccessController.doPrivileged(
|
||||||
new PrivilegedAction() {
|
new PrivilegedAction() {
|
||||||
public final Object run() {
|
public final Object run() {
|
||||||
|
try {
|
||||||
String lib_path = System.getProperty("net.java.games.input.librarypath");
|
String lib_path = System.getProperty("net.java.games.input.librarypath");
|
||||||
if (lib_path != null)
|
if (lib_path != null)
|
||||||
System.load(lib_path + File.separator + System.mapLibraryName(lib_name));
|
System.load(lib_path + File.separator + System.mapLibraryName(lib_name));
|
||||||
else
|
else
|
||||||
System.loadLibrary(lib_name);
|
System.loadLibrary(lib_name);
|
||||||
|
} catch (UnsatisfiedLinkError e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
supported = false;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -88,16 +88,17 @@ public final class LinuxEnvironmentPlugin extends ControllerEnvironment implemen
|
||||||
static {
|
static {
|
||||||
String osName = getPrivilegedProperty("os.name", "").trim();
|
String osName = getPrivilegedProperty("os.name", "").trim();
|
||||||
if(osName.equals("Linux")) {
|
if(osName.equals("Linux")) {
|
||||||
supported = true;
|
|
||||||
try {
|
try {
|
||||||
loadLibrary(LIBNAME);
|
loadLibrary(LIBNAME);
|
||||||
|
supported = true;
|
||||||
} catch (UnsatisfiedLinkError e) {
|
} catch (UnsatisfiedLinkError e) {
|
||||||
try {
|
try {
|
||||||
loadLibrary(LIBNAME + POSTFIX64BIT);
|
loadLibrary(LIBNAME + POSTFIX64BIT);
|
||||||
|
supported = true;
|
||||||
} catch (UnsatisfiedLinkError e2) {
|
} catch (UnsatisfiedLinkError e2) {
|
||||||
logln("Failed to load 64 bit library: " + e2.getMessage());
|
logln("Failed to load 64 bit library: " + e2.getMessage());
|
||||||
// throw original error
|
e.printStackTrace();
|
||||||
throw e;
|
supported = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue