blob: 4d808b4b155fbcd0a2d54b2df2fe508362833466 (
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 unsúpported. Only supported on linux.");
}
return null;
}
}
|