JNI_VERSION restructure

This commit is contained in:
Brian Matzon 2006-11-18 21:56:31 +00:00
parent 88d377ca74
commit 1e806b9188
2 changed files with 10 additions and 7 deletions

View File

@ -194,6 +194,9 @@ public class FMOD {
/** Version of FMOD */
public static final String VERSION = "1.0beta3";
/** Current version of the JNI library */
static final int JNI_VERSION = 1;
static {
initialize();
@ -211,10 +214,10 @@ public class FMOD {
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 + "'");
}
@ -242,7 +245,7 @@ public class FMOD {
/**
* Return the version of the native library
*/
private static native String getNativeLibraryVersion();
private static native int getNativeLibraryVersion();
/**
* @return true if AL has been created

View File

@ -38,10 +38,10 @@ static const char* VERSION = "1.0beta3";
/*
* Class: org_lwjgl_fmod3_FMOD
* Method: getNativeLibraryVersion
* Signature: ()Ljava/lang/String;
* Signature: ()I
*/
JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod3_FMOD_getNativeLibraryVersion(JNIEnv * env, jclass clazz) {
return NewStringNative(env, VERSION);
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod3_FMOD_getNativeLibraryVersion(JNIEnv * env, jclass clazz) {
return org_lwjgl_fmod3_FMOD_JNI_VERSION;
}
/*