Rev 3022 | Rev 4420 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3022 | Rev 4055 | ||
---|---|---|---|
Line 49... | Line 49... | ||
49 | 49 | ||
50 | #define uint16_t_be2host(n) (n) |
50 | #define uint16_t_be2host(n) (n) |
51 | #define uint32_t_be2host(n) (n) |
51 | #define uint32_t_be2host(n) (n) |
52 | #define uint64_t_be2host(n) (n) |
52 | #define uint64_t_be2host(n) (n) |
53 | 53 | ||
- | 54 | #define host2uint16_t_le(n) uint16_t_byteorder_swap(n) |
|
- | 55 | #define host2uint32_t_le(n) uint32_t_byteorder_swap(n) |
|
- | 56 | #define host2uint64_t_le(n) uint64_t_byteorder_swap(n) |
|
- | 57 | ||
- | 58 | #define host2uint16_t_be(n) (n) |
|
- | 59 | #define host2uint32_t_be(n) (n) |
|
- | 60 | #define host2uint64_t_be(n) (n) |
|
- | 61 | ||
54 | #else |
62 | #else |
55 | 63 | ||
56 | #define uint16_t_le2host(n) (n) |
64 | #define uint16_t_le2host(n) (n) |
57 | #define uint32_t_le2host(n) (n) |
65 | #define uint32_t_le2host(n) (n) |
58 | #define uint64_t_le2host(n) (n) |
66 | #define uint64_t_le2host(n) (n) |
59 | 67 | ||
60 | #define uint16_t_be2host(n) uint16_t_byteorder_swap(n) |
68 | #define uint16_t_be2host(n) uint16_t_byteorder_swap(n) |
61 | #define uint32_t_be2host(n) uint32_t_byteorder_swap(n) |
69 | #define uint32_t_be2host(n) uint32_t_byteorder_swap(n) |
62 | #define uint64_t_be2host(n) uint64_t_byteorder_swap(n) |
70 | #define uint64_t_be2host(n) uint64_t_byteorder_swap(n) |
63 | 71 | ||
- | 72 | #define host2uint16_t_le(n) (n) |
|
- | 73 | #define host2uint32_t_le(n) (n) |
|
- | 74 | #define host2uint64_t_le(n) (n) |
|
- | 75 | ||
- | 76 | #define host2uint16_t_be(n) uint16_t_byteorder_swap(n) |
|
- | 77 | #define host2uint32_t_be(n) uint32_t_byteorder_swap(n) |
|
- | 78 | #define host2uint64_t_be(n) uint64_t_byteorder_swap(n) |
|
- | 79 | ||
64 | #endif |
80 | #endif |
65 | 81 | ||
66 | static inline uint64_t uint64_t_byteorder_swap(uint64_t n) |
82 | static inline uint64_t uint64_t_byteorder_swap(uint64_t n) |
67 | { |
83 | { |
68 | return ((n & 0xff) << 56) | |
84 | return ((n & 0xff) << 56) | |