1 #ifndef COMMON_ENDIANNESS_H_INCLUDED
2 #define COMMON_ENDIANNESS_H_INCLUDED
6 #define SWAP_VAR(a, b) do { unsigned char t = a; a = b; b = t; } while(0)
8 static /*inline*/ int16_t short2swap (int16_t x
) {
14 SWAP_VAR(y
.a
[0], y
.a
[1]);
18 static /*inline*/ int32_t int2swap (int32_t x
) {
24 SWAP_VAR(y
.a
[0], y
.a
[3]);
25 SWAP_VAR(y
.a
[1], y
.a
[2]);
31 static /*inline*/ int16_t short2host (int16_t x
) {
39 static /*inline*/ int32_t int2host (int32_t x
) {
47 #endif /* COMMON_ENDIANNESS_H_INCLUDED */