blob: 6116315732d716f721a5004be47dfbf94c8be9a6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package com.yahoo.nativec;
import com.sun.jna.Native;
import com.sun.jna.Platform;
class NativeC {
static Throwable loadLibrary(Class<?> cls) {
if (Platform.isLinux()) {
try {
Native.register(cls, Platform.C_LIBRARY_NAME);
} catch (Throwable e) {
return e;
}
} else {
return new RuntimeException("Platform is unsupported. Only supported on Linux.");
}
return null;
}
}
|