summaryrefslogtreecommitdiff
path: root/win32.h
diff options
context:
space:
mode:
authorMarcus Geelnard <marcus.geelnard@smarteye.se>2019-05-08 14:59:06 +0200
committerm <m@bitsnbites.eu>2019-08-09 11:49:02 +0200
commit85fee2565364cb31b72252a07538c97a52e48ca7 (patch)
treeb904ce3f24c9cd974abe14ffede8c2eaf1ffad6a /win32.h
parent3af99d5fd5c2352cd73e851686bb18de122897f1 (diff)
MinGW fix: Use _MSC_VER instead of _WIN32 where appropriate
Use _MSC_VER (instead of _WIN32) for things that are specific for Visual Studio. Also remove #include <winsock2.h> from hiredis.h, as it leaks too many symbols and defines into the global namespace, which is undesirable for a public interface header. Anyone who uses the the affected parts of the hiredis API needs to include the appropriate headers anyway in order to declare struct timeval variables.
Diffstat (limited to 'win32.h')
-rw-r--r--win32.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/win32.h b/win32.h
index 7cb5706..04289c6 100644
--- a/win32.h
+++ b/win32.h
@@ -2,10 +2,20 @@
#define _WIN32_HELPER_INCLUDE
#ifdef _MSC_VER
+#include <winsock2.h> /* for struct timeval */
+
#ifndef inline
#define inline __inline
#endif
+#ifndef strcasecmp
+#define strcasecmp stricmp
+#endif
+
+#ifndef strncasecmp
+#define strncasecmp strnicmp
+#endif
+
#ifndef va_copy
#define va_copy(d,s) ((d) = (s))
#endif