Fixed Mac OS X compilation of common
This commit is contained in:
parent
6351f2efa3
commit
b1ce8014fc
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
static bool debug = false;
|
static bool debug = false;
|
||||||
static const char* VERSION = "0.93";
|
static const char* VERSION = "0.93";
|
||||||
JavaVM *jvm;
|
static JavaVM *jvm;
|
||||||
|
|
||||||
void initAttribList(attrib_list_t *list) {
|
void initAttribList(attrib_list_t *list) {
|
||||||
list->current_index = 0;
|
list->current_index = 0;
|
||||||
|
@ -217,9 +217,14 @@ bool getBooleanProperty(JNIEnv *env, const char* propertyName) {
|
||||||
return (*env)->CallStaticBooleanMethod(env, booleanClass, getBoolean, property) ? true : false;
|
return (*env)->CallStaticBooleanMethod(env, booleanClass, getBoolean, property) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JavaVM *getJVM() {
|
||||||
|
return jvm;
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
|
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||||
jvm = vm;
|
jvm = vm;
|
||||||
return JNI_VERSION_1_4;
|
return JNI_VERSION_1_4;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) {
|
JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,9 +43,6 @@
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
#include "org_lwjgl_Sys.h"
|
#include "org_lwjgl_Sys.h"
|
||||||
|
|
||||||
// shared VM instance
|
|
||||||
extern JavaVM *jvm;
|
|
||||||
|
|
||||||
#define EVENT_BUFFER_SIZE 256
|
#define EVENT_BUFFER_SIZE 256
|
||||||
#define ATTRIB_LIST_SIZE (256)
|
#define ATTRIB_LIST_SIZE (256)
|
||||||
|
|
||||||
|
@ -61,10 +58,8 @@ typedef struct {
|
||||||
int attribs[ATTRIB_LIST_SIZE];
|
int attribs[ATTRIB_LIST_SIZE];
|
||||||
} attrib_list_t;
|
} attrib_list_t;
|
||||||
|
|
||||||
#ifndef __cplusplus
|
#ifdef _X11
|
||||||
typedef unsigned char bool;
|
typedef enum {false, true} bool;
|
||||||
#define true 1
|
|
||||||
#define false 0
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -118,6 +113,7 @@ typedef struct {
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern JavaVM *getJVM();
|
||||||
extern void initAttribList(attrib_list_t *list);
|
extern void initAttribList(attrib_list_t *list);
|
||||||
extern void putAttrib(attrib_list_t *list, int attrib);
|
extern void putAttrib(attrib_list_t *list, int attrib);
|
||||||
|
|
||||||
|
|
|
@ -499,7 +499,7 @@ void attachMixerThread() {
|
||||||
jfieldID highPriority;
|
jfieldID highPriority;
|
||||||
jint highPriorityValue;
|
jint highPriorityValue;
|
||||||
jmethodID priority;
|
jmethodID priority;
|
||||||
|
JavaVM *jvm = getJVM();
|
||||||
(*jvm)->AttachCurrentThreadAsDaemon(jvm, (void*)&mixer_jnienv, NULL);
|
(*jvm)->AttachCurrentThreadAsDaemon(jvm, (void*)&mixer_jnienv, NULL);
|
||||||
|
|
||||||
// set to high priority
|
// set to high priority
|
||||||
|
|
|
@ -1870,7 +1870,7 @@ void attachStreamThread() {
|
||||||
jfieldID highPriority;
|
jfieldID highPriority;
|
||||||
jint highPriorityValue;
|
jint highPriorityValue;
|
||||||
jmethodID priority;
|
jmethodID priority;
|
||||||
|
JavaVM jvm = getJVM();
|
||||||
(*jvm)->AttachCurrentThreadAsDaemon(jvm, (void*)&stream_jnienv, NULL);
|
(*jvm)->AttachCurrentThreadAsDaemon(jvm, (void*)&stream_jnienv, NULL);
|
||||||
|
|
||||||
// set to high priority
|
// set to high priority
|
||||||
|
|
Loading…
Reference in New Issue