17 #ifndef _INCLUDE_UNIX_COMPAT_H_
18 #define _INCLUDE_UNIX_COMPAT_H_
20 #if (!defined PLATFORM_UNIX)
21 #error PLATFORM_UNIX is not defined.
24 #define __int64 long long
26 #define PLATFORM_SUPPORTS_SDL
34 extern const int hbits[];
40 #define shift_algebraic_right(value,distance) \
41 (((value) >> (distance))| \
42 (hbits[(distance) + (((value) & 0x80000000) >> 26)]))
47 #define outpw(x, y) printf("outpw(0x%X, 0x%X) call in %s, line %d.\n", \
48 (x), (y), __FILE__, __LINE__)
50 #define koutpw(x, y) printf("koutpw(0x%X, 0x%X) call in %s, line %d.\n", \
51 (x), (y), __FILE__, __LINE__)
53 #define outb(x, y) printf("outb(0x%X, 0x%X) call in %s, line %d.\n", \
54 (x), (y), __FILE__, __LINE__)
56 #define koutb(x, y) printf("koutb(0x%X, 0x%X) call in %s, line %d.\n", \
57 (x), (y), __FILE__, __LINE__)
59 #define outp(x, y) printf("outp(0x%X, 0x%X) call in %s, line %d.\n", \
60 (x), (y), __FILE__, __LINE__)
67 #define kinp(x) _kinp_handler((x), __FILE__, __LINE__)
68 #define inp(x) _inp_handler((x), __FILE__, __LINE__)
70 int _inp_handler(
int port,
char *source_file,
int source_line);
71 int _kinp_handler(
int port,
char *source_file,
int source_line);
83 #define kmalloc(x) malloc(x)
84 #define kkmalloc(x) malloc(x)
85 #define kfree(x) free(x)
86 #define kkfree(x) free(x)
87 #define FP_OFF(x) ((long) (x))
94 int stricmp(
const char *x,
const char *y);
96 #if (defined __STRICT_ANSI__)
97 #define inline __inline__
100 #define printext16 printext256
101 #define printext16_noupdate printext256_noupdate
104 long filelength(
int fhandle);
109 #if (!defined S_IREAD)
110 #define S_IREAD S_IRUSR
116 #define stdout ((FILE*)2)
117 #define stderr ((FILE*)2)
121 #define max(x, y) (((x) > (y)) ? (x) : (y))
125 #define min(x, y) (((x) < (y)) ? (x) : (y))