aio recvfrom was not null terminating the result
[jimtcl.git] / jim-win32compat.h
blob21edaf29c4e5c2dc8b8ef2b9330f7867495497a0
1 #ifndef JIM_WIN32COMPAT_H
2 #define JIM_WIN32COMPAT_H
4 #ifndef WIN32
5 #define WIN32 1
6 #endif
7 #ifndef STRICT
8 #define STRICT
9 #endif
11 #define WIN32_LEAN_AND_MEAN
12 #include <windows.h>
14 #if _MSC_VER >= 1000
15 #pragma warning(disable:4146)
16 #endif
18 #define strcasecmp _stricmp
20 #define jim_wide _int64
21 #ifndef LLONG_MAX
22 #define LLONG_MAX 9223372036854775807I64
23 #endif
24 #ifndef LLONG_MIN
25 #define LLONG_MIN (-LLONG_MAX - 1I64)
26 #endif
27 #define JIM_WIDE_MIN LLONG_MIN
28 #define JIM_WIDE_MAX LLONG_MAX
29 #define JIM_WIDE_MODIFIER "I64d"
31 #include <io.h>
33 struct timeval {
34 long tv_sec;
35 long tv_usec;
38 int gettimeofday(struct timeval *tv, void *unused);
40 struct dirent {
41 char *d_name;
44 typedef struct DIR {
45 long handle; /* -1 for failed rewind */
46 struct _finddata_t info;
47 struct dirent result; /* d_name null iff first time */
48 char *name; /* null-terminated char string */
49 } DIR;
51 DIR *opendir(const char *name);
52 int closedir(DIR *dir);
53 struct dirent *readdir(DIR *dir);
55 #endif