Add a general purpose hashtable pattern matcher
[jimtcl.git] / jim-win32compat.h
blob8dc0bde36fbb5cc8d00a56b371c65dbe5f005973
1 #ifndef JIM_WIN32COMPAT_H
2 #define JIM_WIN32COMPAT_H
4 /* Compatibility for Windows (mingw and msvc, not cygwin */
6 /* Note that at this point we don't yet have access to jimautoconf.h */
7 #if defined(_WIN32) || defined(WIN32)
9 #define HAVE_DLOPEN
10 void *dlopen(const char *path, int mode);
11 int dlclose(void *handle);
12 void *dlsym(void *handle, const char *symbol);
13 char *dlerror(void);
15 #ifdef _MSC_VER
16 /* These are msvc vs gcc */
18 #if _MSC_VER >= 1000
19 #pragma warning(disable:4146)
20 #endif
22 #include <limits.h>
23 #define jim_wide _int64
24 #ifndef LLONG_MAX
25 #define LLONG_MAX 9223372036854775807I64
26 #endif
27 #ifndef LLONG_MIN
28 #define LLONG_MIN (-LLONG_MAX - 1I64)
29 #endif
30 #define JIM_WIDE_MIN LLONG_MIN
31 #define JIM_WIDE_MAX LLONG_MAX
32 #define JIM_WIDE_MODIFIER "I64d"
33 #define strcasecmp _stricmp
34 #define strtoull _strtoui64
35 #define snprintf _snprintf
37 #include <io.h>
39 struct timeval {
40 long tv_sec;
41 long tv_usec;
44 int gettimeofday(struct timeval *tv, void *unused);
46 #define HAVE_OPENDIR
47 struct dirent {
48 char *d_name;
51 typedef struct DIR {
52 long handle; /* -1 for failed rewind */
53 struct _finddata_t info;
54 struct dirent result; /* d_name null iff first time */
55 char *name; /* null-terminated char string */
56 } DIR;
58 DIR *opendir(const char *name);
59 int closedir(DIR *dir);
60 struct dirent *readdir(DIR *dir);
61 #endif /* _MSC_VER */
63 #endif /* WIN32 */
65 #endif