diff --git a/src/native/common/extal.c b/src/native/common/extal.c index db7a2571..329a9fd3 100644 --- a/src/native/common/extal.c +++ b/src/native/common/extal.c @@ -65,10 +65,10 @@ void* handleOAL; #include #include #include -const struct mach_header* handleOAL; +const struct mach_header* handleOAL = NULL; #endif -alGetProcAddressPROC alGetProcAddress; +alGetProcAddressPROC alGetProcAddress = NULL; /* Loads OpenAL */ static bool LoadOpenAL(JNIEnv *env, jobjectArray oalPaths); diff --git a/src/native/common/extal.h b/src/native/common/extal.h index 7f5512ed..004fe5fc 100644 --- a/src/native/common/extal.h +++ b/src/native/common/extal.h @@ -46,8 +46,8 @@ #include #endif #ifdef _MACOSX -#include -#include +#include +#include #endif #include @@ -59,7 +59,7 @@ void extal_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMet extern "C" { #endif -#ifdef _WIN32 +#if defined(_WIN32) #ifdef _OPENAL32LIB #define ALCAPI __declspec(dllexport) #else @@ -71,49 +71,43 @@ extern "C" { #define ALCAPIENTRY __cdecl #else - #ifdef _MACOSX - #if _MACOSX - typedef struct ALCdevice_struct ALCdevice; - typedef struct ALCcontext_struct ALCcontext; - + #define ALCAPI + #define ALCAPIENTRY + + #ifdef _X11 + /** ALC boolean type. */ + typedef char ALCboolean; + + /** ALC 8bit signed byte. */ + typedef char ALCbyte; + + /** ALC 8bit unsigned byte. */ + typedef unsigned char ALCubyte; + + /** ALC 16bit signed short integer type. */ + typedef short ALCshort; + + /** ALC 16bit unsigned short integer type. */ + typedef unsigned short ALCushort; + + /** ALC 32bit unsigned integer type. */ + typedef unsigned ALCuint; + + /** ALC 32bit signed integer type. */ + typedef int ALCint; + + /** ALC 32bit floating point type. */ + typedef float ALCfloat; + + /** ALC 64bit double point type. */ + typedef double ALCdouble; + + /** ALC 32bit type. */ + typedef unsigned int ALCsizei; + + /** ALC void type */ + typedef void ALCvoid; #endif - #endif - #define ALCAPI - #define ALCAPIENTRY - -/** ALC boolean type. */ -typedef char ALCboolean; - -/** ALC 8bit signed byte. */ -typedef char ALCbyte; - -/** ALC 8bit unsigned byte. */ -typedef unsigned char ALCubyte; - -/** ALC 16bit signed short integer type. */ -typedef short ALCshort; - -/** ALC 16bit unsigned short integer type. */ -typedef unsigned short ALCushort; - -/** ALC 32bit unsigned integer type. */ -typedef unsigned ALCuint; - -/** ALC 32bit signed integer type. */ -typedef int ALCint; - -/** ALC 32bit floating point type. */ -typedef float ALCfloat; - -/** ALC 64bit double point type. */ -typedef double ALCdouble; - -/** ALC 32bit type. */ -typedef unsigned int ALCsizei; - -/** ALC void type */ -typedef void ALCvoid; - #endif #ifdef _WIN32 diff --git a/src/native/common/extgl.c b/src/native/common/extgl.c index da24d3b4..23d3b415 100644 --- a/src/native/common/extgl.c +++ b/src/native/common/extgl.c @@ -85,7 +85,6 @@ aglResetLibraryPROC aglResetLibrary = NULL; aglSurfaceTexturePROC aglSurfaceTexture = NULL; #endif - struct ExtensionTypes extgl_Extensions; #ifdef _WIN32 @@ -269,7 +268,8 @@ bool extgl_QueryExtension(JNIEnv *env, const GLubyte*extensions, const char *nam /*-----------------------------------------------------*/ #ifdef _MACOSX -bool extgl_InitAGL(JNIEnv *env) +// Commecnted out as AGL is not needed +/*bool extgl_InitAGL(JNIEnv *env) { aglChoosePixelFormat = (aglChoosePixelFormatPROC)extgl_GetProcAddress("aglChoosePixelFormat"); aglDestroyPixelFormat = (aglDestroyPixelFormatPROC)extgl_GetProcAddress("aglDestroyPixelFormat"); @@ -306,7 +306,7 @@ bool extgl_InitAGL(JNIEnv *env) aglSurfaceTexture = (aglSurfaceTexturePROC)extgl_GetProcAddress("aglSurfaceTexture"); return !extgl_error; // Split out AGL into extgl_agl.cpp like wgl and glx and replace with InitializeFunctions } - +*/ #endif /*-----------------------------------------------------*/ /* AGL stuff END*/ diff --git a/src/native/common/org_lwjgl_openal_AL10.c b/src/native/common/org_lwjgl_openal_AL10.c index 12893d19..74fae153 100644 --- a/src/native/common/org_lwjgl_openal_AL10.c +++ b/src/native/common/org_lwjgl_openal_AL10.c @@ -98,11 +98,11 @@ typedef ALvoid (ALAPIENTRY *alDistanceModelPROC)( ALenum value ); typedef ALvoid (ALAPIENTRY *alDopplerFactorPROC)( ALfloat value ); typedef ALvoid (ALAPIENTRY *alDopplerVelocityPROC)( ALfloat value ); -alIsExtensionPresentPROC alIsExtensionPresent; -alGetStringPROC alGetString; -alGetErrorPROC alGetError; +alIsExtensionPresentPROC alIsExtensionPresent = NULL; +alGetStringPROC alGetString = NULL; +alGetErrorPROC alGetError = NULL; -alEnablePROC alEnable; +alEnablePROC alEnable = NULL; static alDisablePROC alDisable; static alIsEnabledPROC alIsEnabled; //static alHintPROC alHint; diff --git a/src/native/common/org_lwjgl_openal_ALC.c b/src/native/common/org_lwjgl_openal_ALC.c index 36688b11..b7c4ae6d 100644 --- a/src/native/common/org_lwjgl_openal_ALC.c +++ b/src/native/common/org_lwjgl_openal_ALC.c @@ -59,7 +59,7 @@ typedef ALCboolean (ALCAPIENTRY *alcIsExtensionPresentPROC)(ALCdevice *device,A //typedef ALCvoid* (ALCAPIENTRY *alcGetProcAddressPROC)(ALCdevice *device,ALCubyte *funcName); typedef ALCenum (ALCAPIENTRY *alcGetEnumValuePROC)(ALCdevice *device,ALCubyte *enumName); -alcGetCurrentContextPROC alcGetCurrentContext; +alcGetCurrentContextPROC alcGetCurrentContext = NULL; static alcGetStringPROC alcGetString; static alcGetIntegervPROC alcGetIntegerv; static alcOpenDevicePROC alcOpenDevice;