From 72e3398baf59673bae22a5a4cd1500b3ceec3dd6 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 27 Aug 2017 06:23:31 -0700 Subject: [PATCH] Avoid including AL headers in makehrtf --- utils/makehrtf.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/utils/makehrtf.c b/utils/makehrtf.c index 3e848dde..516318e8 100644 --- a/utils/makehrtf.c +++ b/utils/makehrtf.c @@ -64,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -79,9 +80,18 @@ #include "win_main_utf8.h" -// Rely (if naively) on OpenAL's header for the types used for serialization. -#include "AL/al.h" -#include "AL/alext.h" +/* Define int64_t and uint64_t types */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +/* Fallback if nothing above works */ +#include +#endif #ifndef M_PI #define M_PI (3.14159265358979323846) @@ -252,10 +262,10 @@ typedef enum HeadModelT { typedef unsigned int uint; // Serialization types. The trailing digit indicates the number of bits. -typedef ALubyte uint8; -typedef ALint int32; -typedef ALuint uint32; -typedef ALuint64SOFT uint64; +typedef unsigned char uint8; +typedef int int32; +typedef unsigned int uint32; +typedef uint64_t uint64; // Token reader state for parsing the data set definition. typedef struct TokenReaderT {