aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--OpenAL32/Include/alMain.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 86fc4fd1..32f717a2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -137,6 +137,11 @@ IF(NOT "${HAVE_WINDOWS_H}")
MESSAGE(FATAL_ERROR "No timing function found!")
ENDIF()
+ CHECK_FUNCTION_EXISTS(usleep HAVE_USLEEP)
+ IF(NOT "${HAVE_USLEEP}")
+ MESSAGE(FATAL_ERROR "No sleep function found!")
+ ENDIF()
+
# We need pthreads outside of Windows
CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H)
IF(NOT "${HAVE_PTHREAD_H}")
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index adf3f2c3..113101e4 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -68,6 +68,7 @@ static inline ALuint timeGetTime(void)
return tv.tv_usec/1000 + tv.tv_sec*1000;
}
+#define Sleep(x) ((void)usleep((unsigned int)x*1000))
#define min(x,y) (((x)<(y))?(x):(y))
#define max(x,y) (((x)>(y))?(x):(y))
#endif