diff --git a/mercurial/mpatch.c b/mercurial/mpatch.c --- a/mercurial/mpatch.c +++ b/mercurial/mpatch.c @@ -23,8 +23,21 @@ #include #include #include -#include -#include +#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 + #include +#endif static char mpatch_doc[] = "Efficient binary patching.";