1 #ifndef JIM_WIN32COMPAT_H
2 #define JIM_WIN32COMPAT_H
4 /* Compatibility for Windows (mingw and msvc, not cygwin */
10 /* Note that at this point we don't yet have access to jimautoconf.h */
11 #if defined(_WIN32) || defined(WIN32)
14 void *dlopen(const char *path
, int mode
);
15 int dlclose(void *handle
);
16 void *dlsym(void *handle
, const char *symbol
);
19 /* MS CRT always uses three digits after 'e' */
20 #define JIM_SPRINTF_DOUBLE_NEEDS_FIX
23 /* These are msvc vs gcc */
26 #pragma warning(disable:4146)
30 #define jim_wide _int64
32 #define LLONG_MAX 9223372036854775807I64
35 #define LLONG_MIN (-LLONG_MAX - 1I64)
37 #define JIM_WIDE_MIN LLONG_MIN
38 #define JIM_WIDE_MAX LLONG_MAX
39 #define JIM_WIDE_MODIFIER "I64d"
40 #define strcasecmp _stricmp
41 #define strtoull _strtoui64
42 #define snprintf _snprintf
51 int gettimeofday(struct timeval
*tv
, void *unused
);
59 long handle
; /* -1 for failed rewind */
60 struct _finddata_t info
;
61 struct dirent result
; /* d_name null iff first time */
62 char *name
; /* null-terminated char string */
65 DIR *opendir(const char *name
);
66 int closedir(DIR *dir
);
67 struct dirent
*readdir(DIR *dir
);
69 #elif defined(__MINGW32__)
72 #define strtod __strtod