Fixed Mac OS X compilation of common

This commit is contained in:
Elias Naur 2004-11-02 14:43:16 +00:00
parent 6351f2efa3
commit b1ce8014fc
4 changed files with 11 additions and 10 deletions

View File

@ -43,7 +43,7 @@
static bool debug = false;
static const char* VERSION = "0.93";
JavaVM *jvm;
static JavaVM *jvm;
void initAttribList(attrib_list_t *list) {
list->current_index = 0;
@ -217,9 +217,14 @@ bool getBooleanProperty(JNIEnv *env, const char* propertyName) {
return (*env)->CallStaticBooleanMethod(env, booleanClass, getBoolean, property) ? true : false;
}
JavaVM *getJVM() {
return jvm;
}
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
jvm = vm;
return JNI_VERSION_1_4;
}
JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) {
}

View File

@ -43,9 +43,6 @@
#include <jni.h>
#include "org_lwjgl_Sys.h"
// shared VM instance
extern JavaVM *jvm;
#define EVENT_BUFFER_SIZE 256
#define ATTRIB_LIST_SIZE (256)
@ -61,10 +58,8 @@ typedef struct {
int attribs[ATTRIB_LIST_SIZE];
} attrib_list_t;
#ifndef __cplusplus
typedef unsigned char bool;
#define true 1
#define false 0
#ifdef _X11
typedef enum {false, true} bool;
#endif
#ifdef _WIN32
@ -118,6 +113,7 @@ typedef struct {
extern "C" {
#endif
extern JavaVM *getJVM();
extern void initAttribList(attrib_list_t *list);
extern void putAttrib(attrib_list_t *list, int attrib);

View File

@ -499,7 +499,7 @@ void attachMixerThread() {
jfieldID highPriority;
jint highPriorityValue;
jmethodID priority;
JavaVM *jvm = getJVM();
(*jvm)->AttachCurrentThreadAsDaemon(jvm, (void*)&mixer_jnienv, NULL);
// set to high priority

View File

@ -1870,7 +1870,7 @@ void attachStreamThread() {
jfieldID highPriority;
jint highPriorityValue;
jmethodID priority;
JavaVM jvm = getJVM();
(*jvm)->AttachCurrentThreadAsDaemon(jvm, (void*)&stream_jnienv, NULL);
// set to high priority