equal
deleted
inserted
replaced
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 { |