diff --git a/ares/nameser.h b/ares/nameser.h
index 3553f8bad956268197836c1916d5d128c588fcc8..b6c78aa6d7fdd97d49b746c65b0cc671512531f4 100644
--- a/ares/nameser.h
+++ b/ares/nameser.h
@@ -211,6 +211,7 @@ typedef enum __ns_rcode {
 #define T_MAILA         ns_t_maila
 #define T_ANY           ns_t_any
 
+#ifndef __MINGW32__
 /* protos for the functions we provide in windows_port.c */
 int ares_strncasecmp(const char *s1, const char *s2, size_t n);
 int ares_strcasecmp(const char *s1, const char *s2);
@@ -220,5 +221,6 @@ int ares_strcasecmp(const char *s1, const char *s2);
    same */
 #define strncasecmp(a,b,c) ares_strncasecmp(a,b,c)
 #define strcasecmp(a,b) ares_strcasecmp(a,b)
+#endif
 
 #endif /* ARES_NAMESER_H */
diff --git a/ares/windows_port.c b/ares/windows_port.c
index a168341fdd1efe1c443f6f68756ee900917e05e6..9619306d8443e6243803f82a441dc7309ea342f9 100644
--- a/ares/windows_port.c
+++ b/ares/windows_port.c
@@ -5,6 +5,7 @@
 
 #include "nameser.h"
 
+#ifndef __MINGW32__
 int
 ares_strncasecmp(const char *a, const char *b, size_t n)
 {
@@ -23,6 +24,7 @@ ares_strcasecmp(const char *a, const char *b)
 {
     return strncasecmp(a, b, strlen(a)+1);
 }
+#endif
 
 int 
 ares_gettimeofday(struct timeval *tv, struct timezone *tz)