aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-05-16 23:26:39 -0700
committerChris Robinson <[email protected]>2009-05-16 23:26:39 -0700
commit7e8501123a092a19b8153f7fdeecef2e0c5f0aa2 (patch)
treeda5bd197753be2b257fa263707d144844622e707 /OpenAL32/Include
parentc447eeb2c77d91d11750270aaed36a2354069095 (diff)
Set some common macros in alu.h
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alMain.h10
-rw-r--r--OpenAL32/Include/alu.h41
2 files changed, 46 insertions, 5 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 849ce6e4..82877735 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -4,12 +4,14 @@
#include <string.h>
#include <stdio.h>
-#include "alu.h"
-
#ifdef HAVE_FENV_H
#include <fenv.h>
#endif
+#include "AL/al.h"
+#include "AL/alc.h"
+#include "AL/alext.h"
+
#ifdef _WIN32
#ifndef _WIN32_WINNT
@@ -98,10 +100,8 @@ static inline void Sleep(ALuint t)
#define max(x,y) (((x)>(y))?(x):(y))
#endif
-#include "AL/al.h"
-#include "AL/alc.h"
-#include "AL/alext.h"
#include "alListener.h"
+#include "alu.h"
#ifdef __cplusplus
extern "C" {
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index 7c6e95b7..9bbcc464 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -4,6 +4,47 @@
#include "AL/al.h"
#include "AL/alc.h"
+#ifdef HAVE_FLOAT_H
+#include <float.h>
+#endif
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846 /* pi */
+#define M_PI_2 1.57079632679489661923 /* pi/2 */
+#endif
+
+#ifdef HAVE_SQRTF
+#define aluSqrt(x) ((ALfloat)sqrtf((float)(x)))
+#else
+#define aluSqrt(x) ((ALfloat)sqrt((double)(x)))
+#endif
+
+#ifdef HAVE_ACOSF
+#define aluAcos(x) ((ALfloat)acosf((float)(x)))
+#else
+#define aluAcos(x) ((ALfloat)acos((double)(x)))
+#endif
+
+#ifdef HAVE_ATANF
+#define aluAtan(x) ((ALfloat)atanf((float)(x)))
+#else
+#define aluAtan(x) ((ALfloat)atan((double)(x)))
+#endif
+
+#ifdef HAVE_FABSF
+#define aluFabs(x) ((ALfloat)fabsf((float)(x)))
+#else
+#define aluFabs(x) ((ALfloat)fabs((double)(x)))
+#endif
+
+// fixes for mingw32.
+#if defined(max) && !defined(__max)
+#define __max max
+#endif
+#if defined(min) && !defined(__min)
+#define __min min
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif