18 #ifndef _INCLUDE_WIN32_COMPAT_H_
19 #define _INCLUDE_WIN32_COMPAT_H_
21 #if (!defined PLATFORM_WIN32)
22 #error PLATFORM_WIN32 is not defined.
25 #define PLATFORM_SUPPORTS_SDL
29 #if (!defined _MSC_VER)
40 extern const int hbits[];
46 #define shift_algebraic_right(value,distance) \
47 (((value) >> (distance))| \
48 (hbits[(distance) + (((value) & 0x80000000) >> 26)]))
53 #define outpw(x, y) printf("outpw(0x%X, 0x%X) call in %s, line %d.\n", \
54 (x), (y), __FILE__, __LINE__)
56 #define koutpw(x, y) printf("koutpw(0x%X, 0x%X) call in %s, line %d.\n", \
57 (x), (y), __FILE__, __LINE__)
59 #define outb(x, y) printf("outb(0x%X, 0x%X) call in %s, line %d.\n", \
60 (x), (y), __FILE__, __LINE__)
62 #define koutb(x, y) printf("koutb(0x%X, 0x%X) call in %s, line %d.\n", \
63 (x), (y), __FILE__, __LINE__)
65 #define outp(x, y) printf("outp(0x%X, 0x%X) call in %s, line %d.\n", \
66 (x), (y), __FILE__, __LINE__)
68 #define koutp(x, y) printf("koutp(0x%X, 0x%X) call in %s, line %d.\n", \
69 (x), (y), __FILE__, __LINE__)
71 #define kinp(x) _kinp_handler((x), __FILE__, __LINE__)
72 #define inp(x) _inp_handler((x), __FILE__, __LINE__)
74 int _inp_handler(
int port,
char *source_file,
int source_line);
75 int _kinp_handler(
int port,
char *source_file,
int source_line);
85 #define kmalloc(x) malloc(x)
86 #define kkmalloc(x) malloc(x)
87 #define kfree(x) free(x)
88 #define kkfree(x) free(x)
94 #define FP_OFF(x) ((long) (x))
97 #define printext16 printext256
98 #define printext16_noupdate printext256_noupdate
101 #define max(x, y) (((x) > (y)) ? (x) : (y))
105 #define min(x, y) (((x) < (y)) ? (x) : (y))
108 #if (defined __WATCOMC__)
110 #pragma intrinsic(min);
111 #pragma intrinsic(max);
112 #define __int64 long long
115 #if (defined _MSC_VER)
116 #if ((!defined _INTEGRAL_MAX_BITS) || (_INTEGRAL_MAX_BITS < 64))
117 #error __int64 type not supported
121 #define O_BINARY _O_BINARY
122 #define O_RDONLY _O_RDONLY
123 #define O_WRONLY _O_WRONLY
124 #define O_RDWR _O_RDWR
125 #define O_TRUNC _O_TRUNC
126 #define O_CREAT _O_CREAT
127 #define S_IREAD _S_IREAD
128 #define S_IWRITE _S_IWRITE
129 #define S_IRDWR _S_IRDWR
132 #define snprintf _snprintf