aboutsummaryrefslogtreecommitdiff
path: root/jim-win32compat.h
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2010-10-20 10:55:07 +1000
committerSteve Bennett <steveb@workware.net.au>2010-10-30 20:07:28 +1000
commit8016c1d53332b9ad2af8e49482f7848648995a89 (patch)
treee45d82799d638cdfcc2020e7cc05131b60049384 /jim-win32compat.h
parentbbd43ee01fce3a2b5284154c50dfc9994c913a29 (diff)
downloadjimtcl-8016c1d53332b9ad2af8e49482f7848648995a89.zip
jimtcl-8016c1d53332b9ad2af8e49482f7848648995a89.tar.gz
jimtcl-8016c1d53332b9ad2af8e49482f7848648995a89.tar.bz2
Allow extensions to be built/installed as modules
This includes C extensions and Tcl extensions Also adds windows support (mingw32 and cygwin) Now the sqlite*, readline and win32 extensions are supported Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-win32compat.h')
-rw-r--r--jim-win32compat.h28
1 files changed, 25 insertions, 3 deletions
diff --git a/jim-win32compat.h b/jim-win32compat.h
index 21edaf2..12275ba 100644
--- a/jim-win32compat.h
+++ b/jim-win32compat.h
@@ -1,9 +1,7 @@
#ifndef JIM_WIN32COMPAT_H
#define JIM_WIN32COMPAT_H
-#ifndef WIN32
- #define WIN32 1
-#endif
+#if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__)
#ifndef STRICT
#define STRICT
#endif
@@ -11,6 +9,25 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+/* None of these is needed for cygwin */
+#if !defined(__CYGWIN__)
+
+#define JIM_ANSIC
+#define MKDIR_ONE_ARG
+#define rand_r(S) ((void)(S), rand())
+#define localtime_r(T,TM) ((void)(TM), localtime(T))
+
+#define HAVE_DLOPEN_COMPAT
+
+#define RTLD_LAZY 0
+void *dlopen(const char *path, int mode);
+int dlclose(void *handle);
+void *dlsym(void *handle, const char *symbol);
+const char *dlerror(void);
+
+#if !defined(__MINGW32__)
+/* Most of these are really gcc vs msvc */
+
#if _MSC_VER >= 1000
#pragma warning(disable:4146)
#endif
@@ -51,5 +68,10 @@ typedef struct DIR {
DIR *opendir(const char *name);
int closedir(DIR *dir);
struct dirent *readdir(DIR *dir);
+#endif /* MSC */
+
+#endif /* __MINGW32__ */
+
+#endif /* __CYGWIN__ */
#endif