aboutsummaryrefslogtreecommitdiff
path: root/libs/alsa-lib/patches/200-usleep.patch
blob: 91d0b7744f027142297f4f97cffaa2e18b42c5e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- a/src/pcm/pcm_shm.c
+++ b/src/pcm/pcm_shm.c
@@ -46,6 +46,14 @@
 #include <netdb.h>
 #include "aserver.h"
 
+#if _POSIX_C_SOURCE >= 200809L
+#define usleep(a) \
+	do { \
+		const struct timespec req = {0, a * 1000}; \
+		nanosleep(&req, NULL); \
+	} while(0)
+#endif
+
 #ifndef PIC
 /* entry for static linking */
 const char *_snd_module_pcm_shm = "";
--- a/src/ucm/ucm_local.h
+++ b/src/ucm/ucm_local.h
@@ -61,6 +61,14 @@
 #define SEQUENCE_ELEMENT_TYPE_DEV_DISABLE_SEQ	14
 #define SEQUENCE_ELEMENT_TYPE_DEV_DISABLE_ALL	15
 
+#if _POSIX_C_SOURCE >= 200809L
+#define usleep(a) \
+	do { \
+		const struct timespec req = {0, a * 1000}; \
+		nanosleep(&req, NULL); \
+	} while(0)
+#endif
+
 struct ucm_value {
         struct list_head list;
         char *name;