|
|
1 | |
|
|
2 | #ifdef _MSC_VER |
|
|
3 | |
|
|
4 | #include <stdlib.h> |
|
|
5 | #define bswap_32(x) _byteswap_ulong(x) |
|
|
6 | #define bswap_64(x) _byteswap_uint64(x) |
|
|
7 | |
|
|
8 | #elif defined(__APPLE__) |
|
|
9 | |
|
|
10 | // Mac OS X / Darwin features |
|
|
11 | #include <libkern/OSByteOrder.h> |
|
|
12 | #define bswap_32(x) OSSwapInt32(x) |
|
|
13 | #define bswap_64(x) OSSwapInt64(x) |
|
|
14 | |
|
|
15 | #elif defined(__sun) || defined(sun) |
|
|
16 | |
|
|
17 | #include <sys/byteorder.h> |
|
|
18 | #define bswap_32(x) BSWAP_32(x) |
|
|
19 | #define bswap_64(x) BSWAP_64(x) |
|
|
20 | |
|
|
21 | #elif defined(__FreeBSD__) |
|
|
22 | |
|
|
23 | #include <sys/endian.h> |
|
|
24 | #define bswap_32(x) bswap32(x) |
|
|
25 | #define bswap_64(x) bswap64(x) |
|
|
26 | |
|
|
27 | #elif defined(__OpenBSD__) |
|
|
28 | |
|
|
29 | #include <sys/types.h> |
|
|
30 | #define bswap_32(x) swap32(x) |
|
|
31 | #define bswap_64(x) swap64(x) |
|
|
32 | |
|
|
33 | #elif defined(__NetBSD__) |
|
|
34 | |
|
|
35 | #include <sys/types.h> |
|
|
36 | #include <machine/bswap.h> |
|
|
37 | #if defined(__BSWAP_RENAME) && !defined(__bswap_32) |
|
|
38 | #define bswap_32(x) bswap32(x) |
|
|
39 | #define bswap_64(x) bswap64(x) |
|
|
40 | #endif |
|
|
41 | |
|
|
42 | #else |
|
|
43 | |
|
|
44 | #include <byteswap.h> |
|
|
45 | |
|
|
46 | #endif |
|
|
47 | |
1 | 0x00010001 |
48 | 0x00010001 |
2 | - add ecb_is_pot32/64. |
49 | - add ecb_is_pot32/64. |
3 | - add intptr_t/uintptr_t. |
50 | - add intptr_t/uintptr_t. |
4 | - add ECB_PTRSIZE. |
51 | - add ECB_PTRSIZE. |
5 | - more macros for C/C++ version checks. |
52 | - more macros for C/C++ version checks. |