JNI_VERSION restructure

This commit is contained in:
Brian Matzon 2006-11-18 22:03:02 +00:00
parent 1e806b9188
commit fa242848af
2 changed files with 11 additions and 7 deletions

View file

@ -54,6 +54,9 @@ class ILNative {
/** Version of IL */
public static final String VERSION = "1.0beta3";
/** Current version of the JNI library */
static final int JNI_VERSION = 1;
private static void loadLibrary(final String lib_name) {
AccessController.doPrivileged(new PrivilegedAction() {
@ -74,10 +77,10 @@ class ILNative {
loadLibrary(JNI_LIBRARY_NAME);
// check for mismatch
String nativeVersion = getNativeLibraryVersion();
if (!nativeVersion.equals(VERSION)) {
int nativeVersion = getNativeLibraryVersion();
if (nativeVersion != JNI_VERSION) {
throw new LinkageError(
"Version mismatch: jar version is '" + VERSION +
"Version mismatch: jar version is '" + JNI_VERSION +
"', native libary version is '" + nativeVersion + "'");
}
}
@ -88,7 +91,7 @@ class ILNative {
static native void resetNativeStubsIL(Class clazz);
static native void nCreateIL(String[] ilPaths) throws LWJGLException;
static native void nDestroyIL();
private static native String getNativeLibraryVersion();
private static native int getNativeLibraryVersion();
static void createIL() throws LWJGLException {
String[] illPaths = LWJGLUtil.getLibraryPaths(new String[]{