hostlib.h
Go to the documentation of this file.
1 
20 #pragma once
21 
22 // Required for sleep(), ftruncate(), probably others
23 #undef _POSIX_C_SOURCE
24 #define _POSIX_C_SOURCE 200112L
25 
26 #ifdef __WIN32
27 // Prevent early inclusion of winsock.h
28 #include <winsock2.h>
29 #endif
30 
31 #include <fcntl.h>
32 #include <limits.h>
33 #include <stdint.h>
34 #include <stdbool.h>
35 #include <stddef.h>
36 #include <unistd.h>
37 
38 #ifndef O_BINARY
39 #define O_BINARY 0
40 #endif
41 
42 #ifndef ARRAY_SIZE
43 #define ARRAY_SIZE(x) (int)(sizeof(x) / sizeof((x)[0]))
44 #endif
45 
46 // Used for parameterised token pasting
47 #ifndef JOIN
48 #define JOIN_AGAIN(_a, _b) _a##_b
49 #define JOIN(_a, _b) JOIN_AGAIN(_a, _b)
50 #endif
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 int msleep(unsigned ms);
57 
64 size_t getHostAppDir(char* path, size_t bufSize);
65 
66 #ifdef __cplusplus
67 }
68 #endif
size_t getHostAppDir(char *path, size_t bufSize)
Get directory where application is executing from.
int msleep(unsigned ms)