mercurial/bdiff.c
changeset 472 aa3d592df9b9
parent 464 50da4bb9cab6
child 474 b2ae8283d1a6
child 484 934279f3ca53
equal deleted inserted replaced
471:4c7f687e4313 472:aa3d592df9b9
    10 */
    10 */
    11 
    11 
    12 #include <Python.h>
    12 #include <Python.h>
    13 #include <stdlib.h>
    13 #include <stdlib.h>
    14 #include <string.h>
    14 #include <string.h>
       
    15 #include <stdint.h>
    15 #ifdef _WIN32
    16 #ifdef _WIN32
    16 
       
    17 typedef unsigned long uint32_t;
       
    18 
       
    19 static uint32_t htonl(uint32_t x)
    17 static uint32_t htonl(uint32_t x)
    20 {
    18 {
    21 	return ((x & 0x000000ffUL) << 24) |
    19 	return ((x & 0x000000ffUL) << 24) |
    22 		((x & 0x0000ff00UL) <<  8) |
    20 		((x & 0x0000ff00UL) <<  8) |
    23 		((x & 0x00ff0000UL) >>  8) |
    21 		((x & 0x00ff0000UL) >>  8) |
    24 		((x & 0xff000000UL) >> 24);
    22 		((x & 0xff000000UL) >> 24);
    25 }
    23 }
    26 
       
    27 #else
    24 #else
    28   #include <netinet/in.h>
    25 #include <netinet/in.h>
    29   #include <sys/types.h>
       
    30   #include <stdint.h>
       
    31 #endif
    26 #endif
    32 
    27 
    33 struct line {
    28 struct line {
    34 	int h, len, n, e;
    29 	int h, len, n, e;
    35 	const char *l;
    30 	const char *l;