From 3a8e2b59f1eeeae2c21ed2bb4615c7eaea633610 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 14 Dec 2002 13:37:46 +0000 Subject: [PATCH] Fixed oal dynamic loading on linux --- src/native/common/extal.c | 5 +++-- src/native/common/extal.h | 20 +++++++++++++------- src/native/common/org_lwjgl_openal_ALUT.cpp | 4 +++- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/native/common/extal.c b/src/native/common/extal.c index 546a1d4c..0c310458 100644 --- a/src/native/common/extal.c +++ b/src/native/common/extal.c @@ -30,6 +30,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include "extal.h" /** @@ -111,11 +112,11 @@ alcIsExtensionPresentPROC alcIsExtensionPresent = NULL; alcGetProcAddressPROC alcGetProcAddress = NULL; alcGetEnumValuePROC alcGetEnumValue = NULL; +#ifdef _WIN32 EAXSet eaxSet; // EAXSet function, ret$ EAXGet eaxGet; // EAXGet function, ret$ /* Handle to OpenAL Library */ -#ifdef WIN32 HMODULE handleOAL; #else void* handleOAL; @@ -383,4 +384,4 @@ int LoadALC() { */ int LoadALExtensions() { return 1; -} \ No newline at end of file +} diff --git a/src/native/common/extal.h b/src/native/common/extal.h index df6bac6e..5001d925 100644 --- a/src/native/common/extal.h +++ b/src/native/common/extal.h @@ -33,7 +33,9 @@ #ifndef _AL_TEST_H #define _AL_TEST_H +#ifdef _WIN32 #include +#endif #include #include @@ -51,9 +53,6 @@ extern "C" { #define ALCAPI __declspec(dllimport) #endif - typedef struct ALCdevice_struct ALCdevice; - typedef struct ALCcontext_struct ALCcontext; - #define ALCAPIENTRY __cdecl #else #ifdef TARGET_OS_MAC @@ -62,7 +61,7 @@ extern "C" { #endif #endif #define ALCAPI - #define ALCAPIENTRY __cdecl + #define ALCAPIENTRY #endif #ifdef _WIN32 @@ -80,10 +79,11 @@ extern "C" { #endif #endif #define ALAPI - #define ALAPIENTRY __cdecl + #define ALAPIENTRY #define AL_CALLBACK #endif +#ifdef _WIN32 DEFINE_GUID(DSPROPSETID_EAX20_ListenerProperties, 0x306a6a8, 0xb224, @@ -95,15 +95,19 @@ DEFINE_GUID(DSPROPSETID_EAX20_BufferProperties, 0xb224, 0x11d2, 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22); +#endif #define INITGUID #define OPENAL + typedef struct ALCdevice_struct ALCdevice; + typedef struct ALCcontext_struct ALCcontext; + int InitializeOpenAL(); void DeInitializeOpenAL(); //alc -typedef ALCubyte* (ALCAPIENTRY *alcGetStringPROC)(ALCdevice *device,ALCenum param); +typedef ALCubyte* (/*ALCAPIENTRY*/ *alcGetStringPROC)(ALCdevice *device,ALCenum param); typedef ALCvoid (ALCAPIENTRY *alcGetIntegervPROC)(ALCdevice *device,ALCenum param,ALCsizei size,ALCint *data); typedef ALCdevice* (ALCAPIENTRY *alcOpenDevicePROC)(ALCubyte *deviceName); typedef ALCvoid (ALCAPIENTRY *alcCloseDevicePROC)(ALCdevice *device); @@ -252,14 +256,16 @@ extern alDistanceModelPROC alDistanceModel; extern alDopplerFactorPROC alDopplerFactor; extern alDopplerVelocityPROC alDopplerVelocity; +#ifdef _WIN32 typedef ALenum (*EAXSet)(const GUID*, ALuint, ALuint, ALvoid*, ALuint); typedef ALenum (*EAXGet)(const GUID*, ALuint, ALuint, ALvoid*, ALuint); extern EAXSet eaxSet; extern EAXGet eaxGet; +#endif #ifdef __cplusplus } #endif -#endif \ No newline at end of file +#endif diff --git a/src/native/common/org_lwjgl_openal_ALUT.cpp b/src/native/common/org_lwjgl_openal_ALUT.cpp index 867072b7..99bc8ea1 100644 --- a/src/native/common/org_lwjgl_openal_ALUT.cpp +++ b/src/native/common/org_lwjgl_openal_ALUT.cpp @@ -42,7 +42,9 @@ #include "org_lwjgl_openal_ALUT.h" #include +#ifdef _WIN32 #include +#endif /* OpenAL includes */ #include "checkALerror.h" @@ -175,4 +177,4 @@ JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALUT_loadWAVMemory (JNIEnv *env, JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALUT_unloadWAV (JNIEnv *env, jobject obj, jint format, jint data, jint size, jint freq) { alutUnloadWAV(format, (void**) data, size, freq); CHECK_AL_ERROR -} \ No newline at end of file +}