--- libXpm-3.5.9/src/CrBufFrI.c.orig 2010-10-30 00:29:24.000000000 -0500 +++ libXpm-3.5.9/src/CrBufFrI.c 2012-02-22 13:20:17.674397200 -0600 @@ -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)); --- libXpm-3.5.9/src/CrDatFrI.c.orig 2010-10-30 00:29:24.000000000 -0500 +++ libXpm-3.5.9/src/CrDatFrI.c 2012-02-22 13:20:17.678397500 -0600 @@ -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)); --- libXpm-3.5.9/src/WrFFrI.c.orig 2010-10-30 00:29:24.000000000 -0500 +++ libXpm-3.5.9/src/WrFFrI.c 2012-02-22 13:20:17.683397800 -0600 @@ -50,6 +50,13 @@ #include "errno.h" #endif +#ifdef FOR_MSW +#include "fcntl.h" +#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, char *name, XpmInfo *info)); --- libXpm-3.5.9/src/XpmI.h.orig 2010-10-30 00:29:24.000000000 -0500 +++ libXpm-3.5.9/src/XpmI.h 2012-02-22 13:20:17.687398000 -0600 @@ -215,8 +215,13 @@ 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 */