diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-03-22 09:37:17 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-03-22 09:38:36 +0100 |
commit | 86115434f1f60afe51a87d4c1674a3e2c0d18700 (patch) | |
tree | 42c3f4953443225a51421876077b84720825d42a /include/osmocom/netif/osmux.h | |
parent | d69c1ca8fab461ca5cdf65215261df0b2582f7ad (diff) |
endian: Use the new endian macros for portability
Use the new macros to deal with little/big endian. Im a bit
worried to make this change due the little test coverage in
this module but in case of a typo the elements would not be
defined.
Diffstat (limited to 'include/osmocom/netif/osmux.h')
-rw-r--r-- | include/osmocom/netif/osmux.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/osmocom/netif/osmux.h b/include/osmocom/netif/osmux.h index 493f64f..0f6f5c9 100644 --- a/include/osmocom/netif/osmux.h +++ b/include/osmocom/netif/osmux.h @@ -1,6 +1,8 @@ #ifndef _OSMUX_H_ #define _OSMUX_H_ +#include <osmocom/core/endian.h> + /* OSmux header: * * ft (3 bits): 0=signalling, 1=voice @@ -17,12 +19,12 @@ #define OSMUX_FT_VOICE_AMR 1 struct osmux_hdr { -#if __BYTE_ORDER == __BIG_ENDIAN +#if OSMO_IS_BIG_ENDIAN uint8_t ft:3, ctr:3, amr_f:1, amr_q:1; -#elif __BYTE_ORDER == __LITTLE_ENDIAN +#elif OSMO_IS_LITTLE_ENDIAN uint8_t amr_q:1, amr_f:1, ctr:3, @@ -31,10 +33,10 @@ struct osmux_hdr { uint8_t seq; #define OSMUX_CID_MAX 255 /* determined by circuit_id */ uint8_t circuit_id; -#if __BYTE_ORDER == __BIG_ENDIAN +#if OSMO_IS_BIG_ENDIAN uint8_t amr_ft:4, amr_cmr:4; -#elif __BYTE_ORDER == __LITTLE_ENDIAN +#elif OSMO_IS_LITTLE_ENDIAN uint8_t amr_cmr:4, amr_ft:4; #endif |