Show More
@@ -12,8 +12,22 b'' | |||||
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 <netinet/in.h> |
|
15 | #ifdef _WIN32 | |
16 | #include <sys/types.h> |
|
16 | ||
|
17 | typedef unsigned long uint32_t; | |||
|
18 | ||||
|
19 | static uint32_t htonl(uint32_t x) | |||
|
20 | { | |||
|
21 | return ((x & 0x000000ffUL) << 24) | | |||
|
22 | ((x & 0x0000ff00UL) << 8) | | |||
|
23 | ((x & 0x00ff0000UL) >> 8) | | |||
|
24 | ((x & 0xff000000UL) >> 24); | |||
|
25 | } | |||
|
26 | ||||
|
27 | #else | |||
|
28 | #include <netinet/in.h> | |||
|
29 | #include <sys/types.h> | |||
|
30 | #endif | |||
17 |
|
31 | |||
18 | struct line { |
|
32 | struct line { | |
19 | int h, len, n; |
|
33 | int h, len, n; |
@@ -27,11 +27,12 b'' | |||||
27 |
|
27 | |||
28 | typedef unsigned long uint32_t; |
|
28 | typedef unsigned long uint32_t; | |
29 |
|
29 | |||
30 |
uint32_t ntohl(uint32_t x) |
|
30 | static uint32_t ntohl(uint32_t x) | |
31 | return ((x & 0x000000ffUL) << 24) | |
|
31 | { | |
32 |
|
|
32 | return ((x & 0x000000ffUL) << 24) | | |
33 |
|
|
33 | ((x & 0x0000ff00UL) << 8) | | |
34 |
|
|
34 | ((x & 0x00ff0000UL) >> 8) | | |
|
35 | ((x & 0xff000000UL) >> 24); | |||
35 | } |
|
36 | } | |
36 |
|
37 | |||
37 | #else |
|
38 | #else |
General Comments 0
You need to be logged in to leave comments.
Login now