aboutsummaryrefslogtreecommitdiff
path: root/ports/libsoundio/fix_test.patch
blob: dc92c2d1b305f11ab1c012b779cabca643efe2a0 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
diff --git a/backend_disconnect_recover.c b/backend_disconnect_recover.c
index 046a150..7c89df7 100644
--- a/backend_disconnect_recover.c
+++ b/backend_disconnect_recover.c
@@ -12,11 +12,20 @@
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
+#ifdef _WIN32
+#include <windows.h>
+#define sleep(n) Sleep(n * 1000)
+#else
 #include <unistd.h>
+#endif
 
+#ifdef _MSC_VER
+__declspec (noreturn)
+#else
 __attribute__ ((cold))
 __attribute__ ((noreturn))
 __attribute__ ((format (printf, 1, 2)))
+#endif
 static void panic(const char *format, ...) {
     va_list ap;
     va_start(ap, format);
diff --git a/overflow.c b/overflow.c
index 43b6d22..67947fe 100644
--- a/overflow.c
+++ b/overflow.c
@@ -12,7 +12,12 @@
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
+#ifdef _WIN32
+#include <windows.h>
+#define sleep(n) Sleep(n * 1000)
+#else
 #include <unistd.h>
+#endif
 
 static enum SoundIoFormat prioritized_formats[] = {
     SoundIoFormatFloat32NE,
@@ -36,9 +41,13 @@ static enum SoundIoFormat prioritized_formats[] = {
     SoundIoFormatInvalid,
 };
 
+#ifdef _MSC_VER
+__declspec (noreturn)
+#else
 __attribute__ ((cold))
 __attribute__ ((noreturn))
 __attribute__ ((format (printf, 1, 2)))
+#endif
 static void panic(const char *format, ...) {
     va_list ap;
     va_start(ap, format);
diff --git a/underflow.c b/underflow.c
index 083e92d..32907de 100644
--- a/underflow.c
+++ b/underflow.c
@@ -12,12 +12,21 @@
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
+#ifdef _WIN32
+#include <windows.h>
+#define sleep(n) Sleep(n * 1000)
+#else
 #include <unistd.h>
+#endif
 #include <stdint.h>
 
+#ifdef _MSC_VER
+__declspec (noreturn)
+#else
 __attribute__ ((cold))
 __attribute__ ((noreturn))
 __attribute__ ((format (printf, 1, 2)))
+#endif
 static void panic(const char *format, ...) {
     va_list ap;
     va_start(ap, format);