#include <stdio.h>
-#include <AL/al.h>
-#include <AL/alut.h>
+#ifdef __MINGW32__
+// This is broken, but allows the file to compile without a POSIX
+// environment.
+static unsigned int sleep(unsigned int secs) { return 0; }
+#else
+#include <unistd.h> // sleep()
+#endif
+
+#if defined( __APPLE__ )
+# define AL_ILLEGAL_ENUM AL_INVALID_ENUM
+# define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION
+# include <OpenAL/al.h>
+# include <OpenAL/alut.h>
+#else
+# include <AL/al.h>
+# include <AL/alut.h>
+#endif
#include <simgear/debug/logstream.hxx>
}
// Load the sample file
+#if defined (__APPLE__)
+ alutLoadWAVFile( (ALbyte *)"jet.wav", &format, &data, &size, &freq );
+#else
alutLoadWAVFile( (ALbyte *)"jet.wav", &format, &data, &size, &freq, &loop );
+#endif
if (alGetError() != AL_NO_ERROR) {
SG_LOG( SG_GENERAL, SG_ALERT, "Failed to load wav file.");
}