mercurial/mpatch.c
changeset 472 aa3d592df9b9
parent 464 50da4bb9cab6
child 486 098d1f039c18
child 495 e94cebc60d96
equal deleted inserted replaced
471:4c7f687e4313 472:aa3d592df9b9
    21 */
    21 */
    22 
    22 
    23 #include <Python.h>
    23 #include <Python.h>
    24 #include <stdlib.h>
    24 #include <stdlib.h>
    25 #include <string.h>
    25 #include <string.h>
       
    26 #include <stdint.h>
    26 #ifdef _WIN32
    27 #ifdef _WIN32
    27 
       
    28 typedef unsigned long uint32_t;
       
    29 
       
    30 static uint32_t ntohl(uint32_t x)
    28 static uint32_t ntohl(uint32_t x)
    31 {
    29 {
    32 	return ((x & 0x000000ffUL) << 24) |
    30 	return ((x & 0x000000ffUL) << 24) |
    33 		((x & 0x0000ff00UL) <<  8) |
    31 		((x & 0x0000ff00UL) <<  8) |
    34 		((x & 0x00ff0000UL) >>  8) |
    32 		((x & 0x00ff0000UL) >>  8) |
    35 		((x & 0xff000000UL) >> 24);
    33 		((x & 0xff000000UL) >> 24);
    36 }
    34 }
    37 
       
    38 #else
    35 #else
    39   #include <netinet/in.h>
    36 #include <netinet/in.h>
    40   #include <sys/types.h>
       
    41   #include <stdint.h>
       
    42 #endif
    37 #endif
    43 
    38 
    44 static char mpatch_doc[] = "Efficient binary patching.";
    39 static char mpatch_doc[] = "Efficient binary patching.";
    45 
    40 
    46 struct frag {
    41 struct frag {