#ifndef AL_AL_H #define AL_AL_H #ifdef ANDROID #include #ifndef LOGI #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,"OpenAL",__VA_ARGS__) #endif #ifndef LOGE #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,"OpenAL",__VA_ARGS__) #endif #endif #if defined(__cplusplus) extern "C" { #endif #if defined(AL_LIBTYPE_STATIC) #define AL_API #elif defined(_WIN32) && !defined(_XBOX) #if defined(AL_BUILD_LIBRARY) #define AL_API __declspec(dllexport) #else #define AL_API __declspec(dllimport) #endif #else #if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY) #define AL_API __attribute__((visibility("protected"))) #else #define AL_API extern #endif #endif #if defined(_WIN32) #define AL_APIENTRY __cdecl #else #define AL_APIENTRY #endif #if defined(TARGET_OS_MAC) && TARGET_OS_MAC #pragma export on #endif /* * The OPENAL, ALAPI, ALAPIENTRY, AL_INVALID, AL_ILLEGAL_ENUM, and * AL_ILLEGAL_COMMAND macros are deprecated, but are included for * applications porting code from AL 1.0 */ #define OPENAL #define ALAPI AL_API #define ALAPIENTRY AL_APIENTRY #define AL_INVALID (-1) #define AL_ILLEGAL_ENUM AL_INVALID_ENUM #define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION #define AL_VERSION_1_0 #define AL_VERSION_1_1 /** 8-bit boolean */ typedef char ALboolean; /** character */ typedef char ALchar; /** signed 8-bit 2's complement integer */ typedef signed char ALbyte; /** unsigned 8-bit integer */ typedef unsigned char ALubyte; /** signed 16-bit 2's complement integer */ typedef short ALshort; /** unsigned 16-bit integer */ typedef unsigned short ALushort; /** signed 32-bit 2's complement integer */ typedef int ALint; /** unsigned 32-bit integer */ typedef unsigned int ALuint; /** non-negative 32-bit binary integer size */ typedef int ALsizei; /** enumerated 32-bit value */ typedef int ALenum; /** 32-bit IEEE754 floating-point */ typedef float ALfloat; /** 64-bit IEEE754 floating-point */ typedef double ALdouble; #ifdef OPENAL_FIXED_POINT /* Apportable tries to define int64_t and int32_t if it thinks it is needed. * But this is breaking in a complex project involving both pure C and C++ * something is triggering redefinition errors. The workaround seems to be just using stdint.h. */ #include /** Types and Macros for fixed-point math */ #ifndef INT64_MAX typedef long long int64_t; #define INT64_MAX 9223372036854775807LL #endif #ifndef INT32_MAX typedef int int32_t; #define INT32_MAX 2147483647 #endif // FIXME(apportable) make this int32_t typedef int64_t ALfp; typedef int64_t ALdfp; #define ONE (1<=0 ? 0.5 : -0.5))) #define ALfp2float(x) ((float)(x) / (1<=0 ? 0.5 : -0.5))) #define ALdfp2double(x) ((double)(x) / (1<> OPENAL_FIXED_POINT_SHIFT)) #define int2ALdfp(x) ((ALdfp)(x) << OPENAL_FIXED_POINT_SHIFT) #define ALdfp2int(x) ((ALint)((x) >> OPENAL_FIXED_POINT_SHIFT)) #define ALfpMult(x,y) ((ALfp)((((int64_t)(x))*((int64_t)(y)))>>OPENAL_FIXED_POINT_SHIFT)) #define ALfpDiv(x,y) ((ALfp)(((int64_t)(x) << OPENAL_FIXED_POINT_SHIFT) / (y))) #define ALdfpMult(x,y) ALfpMult(x,y) #define ALdfpDiv(x,y) ALfpDiv(x,y) #define __isnan(x) (0) #define __cos(x) (float2ALfp(cos(ALfp2float(x)))) #define __sin(x) (float2ALfp(sin(ALfp2float(x)))) #define __log10(x) (float2ALfp(log10(ALfp2float(x)))) #define __atan(x) (float2ALfp(atan(ALfp2float(x)))) #define toALfpConst(x) ((x)*(1<