Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 1 | #ifndef _INCL_DUKEWIN_H_ |
| 2 | #define _INCL_DUKEWIN_H_ 1 |
| 3 | |
| 4 | #ifndef _MSC_VER /* might need this. */ |
| 5 | typedef int32_t int32_t __int64; |
| 6 | #endif |
| 7 | |
| 8 | #pragma warning(disable:4761) |
| 9 | |
| 10 | #if USE_SDL |
| 11 | #include "SDL.h" |
| 12 | #endif |
| 13 | |
| 14 | #ifdef _DEBUG |
| 15 | #define STUBBED(x) printf("STUB: %s in %s:%d\n", x, __FILE__, __LINE__) |
| 16 | #else |
| 17 | #define STUBBED(x) |
| 18 | #endif |
| 19 | |
| 20 | #define PATH_SEP_CHAR '\\' |
| 21 | #define PATH_SEP_STR "\\" |
| 22 | |
| 23 | #include <sys/stat.h> |
| 24 | #include <io.h> |
| 25 | #include <assert.h> |
| 26 | |
| 27 | struct find_t |
| 28 | { |
| 29 | int32_t handle; |
| 30 | struct _finddata_t data; |
| 31 | uint8_t name[MAX_PATH]; |
| 32 | }; |
| 33 | int _dos_findfirst(uint8_t *filename, int x, struct find_t *f); |
| 34 | int _dos_findnext(struct find_t *f); |
| 35 | |
| 36 | struct dosdate_t |
| 37 | { |
| 38 | uint8_t day; |
| 39 | uint8_t month; |
| 40 | unsigned int year; |
| 41 | uint8_t dayofweek; |
| 42 | }; |
| 43 | |
| 44 | void _dos_getdate(struct dosdate_t *date); |
| 45 | |
| 46 | #ifndef min |
| 47 | #define min(x, y) ((x) < (y) ? (x) : (y)) |
| 48 | #endif |
| 49 | |
| 50 | #ifndef max |
| 51 | #define max(x, y) ((x) > (y) ? (x) : (y)) |
| 52 | #endif |
| 53 | |
| 54 | #ifdef FP_OFF |
| 55 | #undef FP_OFF |
| 56 | #endif |
| 57 | #define FP_OFF(x) ((int32_t) (x)) |
| 58 | |
| 59 | // 64 megs should be enough for anybody. :) --ryan. |
| 60 | #define Z_AvailHeap() ((64 * 1024) * 1024) |
| 61 | |
| 62 | #define printchrasm(x,y,ch) printf("%c", (uint8_t ) (ch & 0xFF)) |
| 63 | |
| 64 | #define cdecl |
| 65 | |
| 66 | #define open _open |
| 67 | #define O_BINARY _O_BINARY |
| 68 | #define O_RDONLY _O_RDONLY |
| 69 | #define O_WRONLY _O_WRONLY |
| 70 | #define O_RDWR _O_RDWR |
| 71 | #define O_TRUNC _O_TRUNC |
| 72 | #define O_CREAT _O_CREAT |
| 73 | #define S_IREAD _S_IREAD |
| 74 | #define S_IWRITE _S_IWRITE |
| 75 | #define S_IRDWR _S_IRDWR |
| 76 | |
| 77 | #define S_IRUSR S_IREAD |
| 78 | #define S_IWUSR S_IWRITE |
| 79 | #define S_IRGRP 0 |
| 80 | #define S_IWGRP 0 |
| 81 | |
| 82 | #define F_OK 0 |
| 83 | |
| 84 | #define HAVE_PRAGMA_PACK 1 |
| 85 | |
| 86 | #endif |