summaryrefslogtreecommitdiff
path: root/jim-win32compat.h
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2011-06-27 21:34:07 -0700
committerSteve Bennett <steveb@workware.net.au>2011-06-28 16:20:04 +1000
commitdc1e58da45332c2645d39154571835d4fb79c456 (patch)
treee34cd916911b1249ea0838f741272af25841e686 /jim-win32compat.h
parentab51e987cb8a9e9fce6af1eeb3b6309f8c11941f (diff)
Fix support for 64-bit mingw
- Check for mkdir with one arg at configure time - mingw can't really do select(), so support only time events in eventloop - Declare dlerror() to be compatible with mingw Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-win32compat.h')
-rw-r--r--jim-win32compat.h27
1 files changed, 12 insertions, 15 deletions
diff --git a/jim-win32compat.h b/jim-win32compat.h
index 4976579..89e01f5 100644
--- a/jim-win32compat.h
+++ b/jim-win32compat.h
@@ -1,27 +1,24 @@
#ifndef JIM_WIN32COMPAT_H
#define JIM_WIN32COMPAT_H
-#if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__)
+/* Compatibility for Windows (mingw and msvc, not cygwin */
+
+/* Note that at this point we don't yet have access to jimautoconf.h */
+#if defined(_WIN32) || defined(WIN32)
#ifndef STRICT
#define STRICT
#endif
-
-/* None of these is needed for cygwin */
-#if !defined(__CYGWIN__)
-
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-#define JIM_ANSIC
-#define MKDIR_ONE_ARG
-
+#define HAVE_DLOPEN
void *dlopen(const char *path, int mode);
int dlclose(void *handle);
void *dlsym(void *handle, const char *symbol);
-const char *dlerror(void);
+char *dlerror(void);
-#if !defined(__MINGW32__)
-/* Most of these are really gcc vs msvc */
+#ifdef _MSC_VER
+/* These are msvc vs gcc */
#if _MSC_VER >= 1000
#pragma warning(disable:4146)
@@ -42,6 +39,7 @@ const char *dlerror(void);
#include <io.h>
+#define HAVE_GETTIMEOFDAY
struct timeval {
long tv_sec;
long tv_usec;
@@ -49,6 +47,7 @@ struct timeval {
int gettimeofday(struct timeval *tv, void *unused);
+#define HAVE_OPENDIR
struct dirent {
char *d_name;
};
@@ -63,10 +62,8 @@ typedef struct DIR {
DIR *opendir(const char *name);
int closedir(DIR *dir);
struct dirent *readdir(DIR *dir);
-#endif /* MSC */
-
-#endif /* __MINGW32__ */
+#endif /* _MSC_VER */
-#endif /* __CYGWIN__ */
+#endif /* WIN32 */
#endif