# HG changeset patch # User mpm@selenic.com # Date 1119408706 28800 # Node ID 7c678976df3e92264eb951a7856c53116948ce93 # Parent feadc9697b4341141997a083e49e636c86bc8705 Make mpatch.c compilable under the other `OS' -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Make mpatch.c compilable under the other `OS' From: K Thananchayan manifest hash: 7b3033b761b147149fb0bcd6ff6120ccb73f16f1 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCuNJCywK+sNU5EO8RAtMVAKCJxQYOa7VX4DYKDPw02ILjINiDmwCggreC 9Xw/stNxkV7zVY2IFDC14is= =tFmZ -----END PGP SIGNATURE----- diff -r feadc9697b43 -r 7c678976df3e mercurial/mpatch.c --- 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 #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.";