-
Notifications
You must be signed in to change notification settings - Fork 73
/
compat.h
37 lines (23 loc) · 693 Bytes
/
compat.h
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
#ifndef COMPAT_H
#define COMPAT_H
#ifdef __WIN32__
/* Windows variants of various things */
#define JOYSTICK_DEV_OPEN_FLAGS O_RDONLY
#define srandom srand
#define random rand
/* End of Windows variants of various things */
#else
#ifdef __linux__
/* Linux variants of various things */
#define JOYSTICK_DEV_OPEN_FLAGS O_RDONLY | O_NONBLOCK
#define HAS_LINUX_JOYSTICK_INTERFACE 1
#define O_BINARY 0
/* End of Linux variants of various things */
#else
/* Generic variants of various things */
#define JOYSTICK_DEV_OPEN_FLAGS O_RDONLY | O_NONBLOCK
#define O_BINARY 0
/* End of generic variants of various things */
#endif /* __linux__ */
#endif /* __WIN32__ */
#endif /* COMPAT_H */