JNI_VERSION restructure
This commit is contained in:
parent
88d377ca74
commit
1e806b9188
|
@ -195,6 +195,9 @@ public class FMOD {
|
||||||
/** Version of FMOD */
|
/** Version of FMOD */
|
||||||
public static final String VERSION = "1.0beta3";
|
public static final String VERSION = "1.0beta3";
|
||||||
|
|
||||||
|
/** Current version of the JNI library */
|
||||||
|
static final int JNI_VERSION = 1;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
initialize();
|
initialize();
|
||||||
}
|
}
|
||||||
|
@ -211,10 +214,10 @@ public class FMOD {
|
||||||
loadLibrary(JNI_LIBRARY_NAME);
|
loadLibrary(JNI_LIBRARY_NAME);
|
||||||
|
|
||||||
// check for mismatch
|
// check for mismatch
|
||||||
String nativeVersion = getNativeLibraryVersion();
|
int nativeVersion = getNativeLibraryVersion();
|
||||||
if (!nativeVersion.equals(VERSION)) {
|
if (nativeVersion != JNI_VERSION) {
|
||||||
throw new LinkageError(
|
throw new LinkageError(
|
||||||
"Version mismatch: jar version is '" + VERSION +
|
"Version mismatch: jar version is '" + JNI_VERSION +
|
||||||
"', native libary version is '" + nativeVersion + "'");
|
"', native libary version is '" + nativeVersion + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +245,7 @@ public class FMOD {
|
||||||
/**
|
/**
|
||||||
* Return the version of the native library
|
* Return the version of the native library
|
||||||
*/
|
*/
|
||||||
private static native String getNativeLibraryVersion();
|
private static native int getNativeLibraryVersion();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if AL has been created
|
* @return true if AL has been created
|
||||||
|
|
|
@ -38,10 +38,10 @@ static const char* VERSION = "1.0beta3";
|
||||||
/*
|
/*
|
||||||
* Class: org_lwjgl_fmod3_FMOD
|
* Class: org_lwjgl_fmod3_FMOD
|
||||||
* Method: getNativeLibraryVersion
|
* Method: getNativeLibraryVersion
|
||||||
* Signature: ()Ljava/lang/String;
|
* Signature: ()I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod3_FMOD_getNativeLibraryVersion(JNIEnv * env, jclass clazz) {
|
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod3_FMOD_getNativeLibraryVersion(JNIEnv * env, jclass clazz) {
|
||||||
return NewStringNative(env, VERSION);
|
return org_lwjgl_fmod3_FMOD_JNI_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue