-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathcompat.h
More file actions
66 lines (54 loc) · 1.34 KB
/
compat.h
File metadata and controls
66 lines (54 loc) · 1.34 KB
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
#ifndef COMPAT_H
#define COMPAT_H
// DOS conio.h compatibility
#define conio_h_included
/* Common compatibility header
*
* This header provides a compatibility layer for DOS-specific code.
* It can be compiled with or without SDL2 support.
*
* To compile with SDL2:
* zig cc -DUSE_SDL ...
*
* To compile without SDL2 (stub implementation):
* zig cc ...
*
* To disable mouse support (keyboard only):
* zig cc -DDISABLE_MOUSE ...
*/
// Mouse support configuration
#ifndef DISABLE_MOUSE
#define MOUSE_ENABLED 1
#else
#define MOUSE_ENABLED 0
#endif
#ifdef USE_SDL
/* Use real SDL2 implementation */
#include "sdl_compat.h"
#else
/* Use stub implementation for testing without SDL2 */
#include "nosdl_compat.h"
#endif
// DOS type definitions for compatibility
typedef unsigned char BYTE;
typedef unsigned char UBYTE;
typedef int WORD;
typedef unsigned int UWORD;
typedef long LONG;
typedef unsigned long ULONG;
typedef char CHAR;
#ifndef INT8
#define INT8 signed char
#endif
// Minimal function declarations for essential DOS replacements
int init_minimal_dos(void);
void cleanup_minimal_dos(void);
// Master initialization function
static inline int init_all_compat(void) {
return init_minimal_dos();
}
// Master cleanup function
static inline void cleanup_all_compat(void) {
cleanup_minimal_dos();
}
#endif // COMPAT_H