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 | #ifdef _WIN32 | |||
|
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 | |||
15 | #include <netinet/in.h> |
|
28 | #include <netinet/in.h> | |
16 | #include <sys/types.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,7 +27,8 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 | { | |||
31 |
|
|
32 | return ((x & 0x000000ffUL) << 24) | | |
32 |
|
|
33 | ((x & 0x0000ff00UL) << 8) | | |
33 |
|
|
34 | ((x & 0x00ff0000UL) >> 8) | |
General Comments 0
You need to be logged in to leave comments.
Login now