summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/CrBufFrI.c4
-rw-r--r--src/CrDatFrI.c4
-rw-r--r--src/WrFFrI.c6
-rw-r--r--src/XpmI.h5
4 files changed, 19 insertions, 0 deletions
diff --git a/src/CrBufFrI.c b/src/CrBufFrI.c
index 398c645..e2040db 100644
--- a/src/CrBufFrI.c
+++ b/src/CrBufFrI.c
@@ -39,6 +39,10 @@
#endif
#include "XpmI.h"
+#ifdef FOR_MSW
+#define snprintf _snprintf
+#endif
+
LFUNC(WriteColors, int, (char **dataptr, unsigned int *data_size,
unsigned int *used_size, XpmColor *colors,
unsigned int ncolors, unsigned int cpp));
diff --git a/src/CrDatFrI.c b/src/CrDatFrI.c
index 6735bfc..542662f 100644
--- a/src/CrDatFrI.c
+++ b/src/CrDatFrI.c
@@ -39,6 +39,10 @@
#endif
#include "XpmI.h"
+#ifdef FOR_MSW
+#define snprintf _snprintf
+#endif
+
LFUNC(CreateColors, int, (char **dataptr, unsigned int *data_size,
XpmColor *colors, unsigned int ncolors,
unsigned int cpp));
diff --git a/src/WrFFrI.c b/src/WrFFrI.c
index 067c96b..328c987 100644
--- a/src/WrFFrI.c
+++ b/src/WrFFrI.c
@@ -51,6 +51,12 @@
#include "fcntl.h"
+#ifdef FOR_MSW
+#define O_WRONLY _O_WRONLY
+#define O_CREAT _O_CREAT
+#define O_TRUNC _O_TRUNC
+#endif
+
/* MS Windows define a function called WriteFile @#%#&!!! */
LFUNC(xpmWriteFile, int, (FILE *file, XpmImage *image, const char *name,
XpmInfo *info));
diff --git a/src/XpmI.h b/src/XpmI.h
index 122aea5..4360ad3 100644
--- a/src/XpmI.h
+++ b/src/XpmI.h
@@ -216,8 +216,13 @@ FUNC(xpmHashTableFree, void, (xpmHashTable *table));
FUNC(xpmHashSlot, xpmHashAtom *, (xpmHashTable *table, char *s));
FUNC(xpmHashIntern, int, (xpmHashTable *table, char *tag, void *data));
+#if defined(_MSC_VER) && defined(_M_X64)
+#define HashAtomData(i) ((void *)(long long)i)
+#define HashColorIndex(slot) ((unsigned long long)((*slot)->data))
+#else
#define HashAtomData(i) ((void *)(long)i)
#define HashColorIndex(slot) ((unsigned long)((*slot)->data))
+#endif
#define USE_HASHTABLE (cpp > 2 && ncolors > 4)
/* I/O utility */