From 9ef7719734505d04d093ee85fb39b4777816d6ed Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 10 Nov 2016 21:51:45 -0800 Subject: Try to make embedded HRTF data sets work on OSX --- Alc/hrtf.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Alc/hrtf.c') diff --git a/Alc/hrtf.c b/Alc/hrtf.c index 7786befc..ba7ad068 100644 --- a/Alc/hrtf.c +++ b/Alc/hrtf.c @@ -908,6 +908,31 @@ static const ALubyte *GetResource(int name, size_t *size) return LockResource(res); } +#elif defined(__APPLE__) + +#include +#include + +static const ALubyte *GetResource(int name, size_t *size) +{ +#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1070) + /* NOTE: OSX 10.7 and up need to call getsectiondata(&_mh_execute_header, ...). However, that + * call requires 10.7. + */ + if(name == IDR_DEFAULT_44100_MHR) + return getsectiondata(&_mh_execute_header, "binary", "default_44100_mhr", size); + if(name == IDR_DEFAULT_48000_MHR) + return getsectiondata(&_mh_execute_header, "binary", "default_48000_mhr", size); +#else + if(name == IDR_DEFAULT_44100_MHR) + return getsectdata("binary", "default_44100_mhr", size); + if(name == IDR_DEFAULT_48000_MHR) + return getsectdata("binary", "default_48000_mhr", size); +#endif + *size = 0; + return NULL; +} + #else extern const ALubyte _binary_default_44100_mhr_start[] HIDDEN_DECL; -- cgit v1.2.3