Merge lp:~tangent-org/libmemcached/1.0-build/ Build: jenkins-Libmemcached-170
[awesomized/libmemcached] / win32 / wrappers.h
index 20218fd58174d24b457c67d885156ddae05727ae..976303cb32ef00b85f3c37bf2accf405f097cab5 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef WIN32_WRAPPERS_H
 #define WIN32_WRAPPERS_H 1
 
+#include <inttypes.h>
+
 /*
  * One of the Windows headers define interface as a macro, but that
  * is causing problems with the member named "interface" in some of the
  */
 #undef interface
 
+#undef malloc
+#undef realloc
+
+
 /*
  * WinSock use a separate range for error codes. Let's just map to the
  * WinSock ones.
  */
-#define EADDRINUSE WSAEADDRINUSE
-#define EWOULDBLOCK WSAEWOULDBLOCK
-#define EINPROGRESS WSAEINPROGRESS
-#define EALREADY WSAEALREADY
-#define EISCONN WSAEISCONN
-#define ENOTCONN WSAENOTCONN
-#define ENOBUFS WSAENOBUFS
-#define SHUT_RDWR SD_BOTH
+#ifndef EADDRINUSE
+# define EADDRINUSE WSAEADDRINUSE
+#endif
+
+#ifndef EWOULDBLOCK
+# define EWOULDBLOCK WSAEWOULDBLOCK
+#endif
+
+#ifndef EINPROGRESS
+# define EINPROGRESS WSAEINPROGRESS
+#endif
+
+#ifndef EALREADY
+# define EALREADY WSAEALREADY
+#endif
+
+#ifndef EISCONN
+# define EISCONN WSAEISCONN
+#endif
+
+#ifndef ENOTCONN
+# define ENOTCONN WSAENOTCONN
+#endif
+
+#ifndef ENOBUFS
+# define ENOBUFS WSAENOBUFS
+#endif
+
+#ifndef SHUT_RDWR
+# define SHUT_RDWR SD_BOTH
+#endif
 
 /* EAI_SYSTEM isn't defined anywhere... just set it to... 11? */
-#define EAI_SYSTEM 11
+#ifndef EAI_SYSTEM
+# define EAI_SYSTEM 11
+#endif
 
 /* Best effort mapping of functions to alternative functions */
 #define index(a,b) strchr(a,b)