--- a/mercurial/mpatch.c Tue Jun 21 18:51:06 2005 -0800
+++ b/mercurial/mpatch.c Tue Jun 21 18:51:46 2005 -0800
@@ -23,8 +23,21 @@
#include <Python.h>
#include <stdlib.h>
#include <string.h>
-#include <netinet/in.h>
-#include <sys/types.h>
+#ifdef _WIN32
+
+typedef unsigned long uint32_t;
+
+uint32_t ntohl(uint32_t x) {
+ return ((x & 0x000000ffUL) << 24) |
+ ((x & 0x0000ff00UL) << 8) |
+ ((x & 0x00ff0000UL) >> 8) |
+ ((x & 0xff000000UL) >> 24);
+}
+
+#else
+ #include <netinet/in.h>
+ #include <sys/types.h>
+#endif
static char mpatch_doc[] = "Efficient binary patching.";