-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathao.c
More file actions
38 lines (34 loc) · 644 Bytes
/
Copy pathao.c
File metadata and controls
38 lines (34 loc) · 644 Bytes
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
//
// Audio Overload SDK
//
// Portability wrappers.
//
#ifdef WIN32
#include "win32_utf8/win32_utf8.h"
#else
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
#endif
FILE* ao_fopen(const char *fn, const char *mode)
{
return fopen(fn, mode);
}
int ao_mkdir(const char *dirname)
{
#ifdef WIN32
// Let's avoid the entire problem of certain runtimes omitting the
// mode parameter altogether by just using the kernel function.
return CreateDirectoryA(dirname, NULL);
#else
return mkdir(dirname, 0777);
#endif
}
void ao_sleep(unsigned int msecs)
{
#ifdef WIN32
Sleep(msecs);
#else
usleep((useconds_t)(msecs) * 1000);
#endif
}