changeset 411 | 9e9f7ab43ce2 |
parent 400 | 8b067bde6679 |
child 433 | 79c694462294 |
--- a/mercurial/bdiff.c +++ b/mercurial/bdiff.c @@ -12,8 +12,22 @@ #include <Python.h> #include <stdlib.h> #include <string.h> -#include <netinet/in.h> -#include <sys/types.h> +#ifdef _WIN32 + +typedef unsigned long uint32_t; + +static uint32_t htonl(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 struct line { int h, len, n;