--- include/X11/xpm.h~	2013-09-08 07:40:17.000000000 +0300
+++ include/X11/xpm.h	2015-10-03 11:47:22.054500000 +0300
@@ -62,6 +62,18 @@
 #define XpmRevision 11
 #define XpmIncludeVersion ((XpmFormat * 100 + XpmVersion) * 100 + XpmRevision)
 
+/* XPM_NO_X and FOR_MSW are synonymous */
+#ifdef XPM_NO_X
+#  ifndef FOR_MSW
+#    define FOR_MSW
+#  endif
+#endif
+#ifdef FOR_MSW
+#  ifndef XPM_NO_X
+#    define XPM_NO_X
+#  endif
+#endif
+
 #ifndef XPM_NUMBERS
 
 #ifdef FOR_MSW
--- src/simx.h~0	2013-09-08 07:40:17.000000000 +0300
+++ src/simx.h	2015-10-03 11:49:27.179500000 +0300
@@ -138,7 +138,8 @@
 #undef FUNC
 
 /* Some functions and constants that have non-standard names in the
-   MS library.  */
+   MS library, only for the MSVC compiler.  */
+#ifdef _MSC_VER
 #define bzero(addr,sz) memset(addr, 0, sz)
 #define close _close
 #define fdopen _fdopen
@@ -147,6 +148,7 @@
 #define O_RDONLY _O_RDONLY
 #define rindex strrchr
 #define strdup _strdup
+#endif	/* _MSC_VER */
 
 
 #endif /* def FOR_MSW */
--- src/parse.c~0	2013-09-08 07:40:17.000000000 +0300
+++ src/parse.c	2015-10-03 12:04:43.117000000 +0300
@@ -47,6 +47,10 @@
 #include <ctype.h>
 #include <string.h>
 
+#if defined FOR_MSW && !defined _MSC_VER
+void bzero(void *, size_t);
+#endif
+
 #if defined(HAS_STRLCAT) || defined(HAVE_STRLCAT)
 # define STRLCAT(dst, src, dstsize) do { \
   	if (strlcat(dst, src, dstsize) >= (dstsize)) \
