diff options
author | Steve Bennett <steveb@workware.net.au> | 2010-03-03 15:43:34 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2010-10-15 11:02:47 +1000 |
commit | 5b72fc672cece4e426817a124e364b76da6f9704 (patch) | |
tree | 1e0236ba5e547cbda1278351f119f27bbaa12783 /jim-win32compat.h | |
parent | 52b1ccb6859a2029e5b5a6d885e26a2a757ba0b1 (diff) | |
download | jimtcl-5b72fc672cece4e426817a124e364b76da6f9704.zip jimtcl-5b72fc672cece4e426817a124e364b76da6f9704.tar.gz jimtcl-5b72fc672cece4e426817a124e364b76da6f9704.tar.bz2 |
Fix some build problems and add lost features
Add some missing files needed for autoconf
Make jim build standalone and without host jimsh
Use (FILE *) for eventloop file handle
Don't expect to support dynlib if no mmu
Re-add nvp and win32 support (untested)
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-win32compat.h')
-rw-r--r-- | jim-win32compat.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/jim-win32compat.h b/jim-win32compat.h new file mode 100644 index 0000000..7f9d85f --- /dev/null +++ b/jim-win32compat.h @@ -0,0 +1,57 @@ +#ifndef JIM_WIN32COMPAT_H +#define JIM_WIN32COMPAT_H + +#ifndef WIN32 + #define WIN32 1 +#endif +#ifndef STRICT + #define STRICT +#endif + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +#if _MSC_VER >= 1000 + #pragma warning(disable:4146) +#endif + +#undef JIM_DYNLIB + +#define strcasecmp _stricmp + +#define jim_wide _int64 +#ifndef LLONG_MAX + #define LLONG_MAX 9223372036854775807I64 +#endif +#ifndef LLONG_MIN + #define LLONG_MIN (-LLONG_MAX - 1I64) +#endif +#define JIM_WIDE_MIN LLONG_MIN +#define JIM_WIDE_MAX LLONG_MAX +#define JIM_WIDE_MODIFIER "I64d" + +#include <io.h> + +struct timeval { + long tv_sec; + long tv_usec; +}; + +int gettimeofday(struct timeval *tv, void *unused); + +struct dirent { + char *d_name; +}; + +typedef struct DIR { + long handle; /* -1 for failed rewind */ + struct _finddata_t info; + struct dirent result; /* d_name null iff first time */ + char *name; /* null-terminated char string */ +} DIR; + +DIR *opendir(const char *name); +int closedir(DIR *dir); +struct dirent *readdir(DIR *dir); + +#endif |