summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/RdFToI.c4
-rw-r--r--src/XpmI.h4
-rw-r--r--src/simx.h17
3 files changed, 24 insertions, 1 deletions
diff --git a/src/RdFToI.c b/src/RdFToI.c
index 35fe78e..60db54a 100644
--- a/src/RdFToI.c
+++ b/src/RdFToI.c
@@ -44,6 +44,10 @@
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
+#else
+#ifdef FOR_MSW
+#include <fcntl.h>
+#endif
#endif
LFUNC(OpenReadFile, int, (char *filename, xpmData *mdata));
diff --git a/src/XpmI.h b/src/XpmI.h
index 70844ac..e9f28cc 100644
--- a/src/XpmI.h
+++ b/src/XpmI.h
@@ -58,9 +58,13 @@
extern FILE *popen();
#endif
+#ifdef FOR_MSW
+#include "simx.h"
+#else
#include <X11/Xos.h>
#include <X11/Xfuncs.h>
#include <X11/Xmd.h>
+#endif
#ifdef VMS
#include <unixio.h>
diff --git a/src/simx.h b/src/simx.h
index 001cfdb..7c4c4b9 100644
--- a/src/simx.h
+++ b/src/simx.h
@@ -40,6 +40,9 @@
#ifdef FOR_MSW
#include "windows.h" /* MS windows GDI types */
+#define _XFUNCPROTOBEGIN
+#define _XFUNCPROTOEND
+#define NO_ZPIPE
/*
* minimal portability layer between ansi and KR C
@@ -101,7 +104,7 @@ extern "C" {
/* color related */
FUNC(XParseColor, int, (Display *, Colormap *, char *, XColor *));
- FUNC(XAllocColor, int, (Display *, Colormap *, XColor *));
+ FUNC(XAllocColor, int, (Display *, Colormap, XColor *));
FUNC(XQueryColors, void, (Display *display, Colormap *colormap,
XColor *xcolors, int ncolors));
FUNC(XFreeColors, int, (Display *d, Colormap cmap,
@@ -134,6 +137,18 @@ typedef BOOL Bool; /* take MSW bool */
#undef LFUNC
#undef FUNC
+/* Some functions and constants that have non-standard names in the
+ MS library. */
+#define bzero(addr,sz) memset(addr, 0, sz)
+#define close _close
+#define fdopen _fdopen
+#define index strchr
+#define open _open
+#define O_RDONLY _O_RDONLY
+#define rindex strrchr
+#define strdup _strdup
+
+
#endif /* def FOR_MSW */
#endif /* _SIMX_H */