aboutsummaryrefslogtreecommitdiff
path: root/ports/libsoundio/fix_example.patch
blob: 39bbb9b02393024f293b78c8fdb612b832204c91 (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
diff --git a/sio_microphone.c b/sio_microphone.c
index 0fa8cca..5c89656 100644
--- a/sio_microphone.c
+++ b/sio_microphone.c
@@ -45,10 +45,13 @@ static int prioritized_sample_rates[] = {
     0,
 };
 
-
+#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/sio_record.c b/sio_record.c
index 61d584d..c33b05e 100644
--- a/sio_record.c
+++ b/sio_record.c
@@ -12,7 +12,12 @@
 #include <string.h>
 #include <math.h>
 #include <errno.h>
+#ifdef _WIN32
+#include <windows.h>
+#define sleep(n) Sleep(n * 1000)
+#else
 #include <unistd.h>
+#endif
 
 struct RecordContext {
     struct SoundIoRingBuffer *ring_buffer;