]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/openal_test1.cxx
Update the code a bit more, add a function to retreive the last error string and...
[simgear.git] / simgear / sound / openal_test1.cxx
index 90aac164a526bd3d0287e2079d76c53156f9dcbf..5d56bc9e83222ae9df692ad0faa3b61a876b108d 100644 (file)
@@ -1,5 +1,13 @@
 #include <stdio.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
@@ -99,7 +107,11 @@ int main( int argc, char *argv[] ) {
     }
 
     // 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.");
     }