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 /examples | |
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 'examples')
-rw-r--r-- | examples/rs232-write.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/rs232-write.c b/examples/rs232-write.c index 370bd12..11498f3 100644 --- a/examples/rs232-write.c +++ b/examples/rs232-write.c @@ -9,6 +9,7 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/logging.h> #include <osmocom/core/application.h> +#include <osmocom/core/endian.h> #include <osmocom/netif/rs232.h> @@ -110,13 +111,13 @@ static void ubx_checksum(struct msgb *msg, uint8_t *ck) } } -# if __BYTE_ORDER == __LITTLE_ENDIAN +# if OSMO_IS_LITTLE_ENDIAN # define utohl(x) (x) # define utohs(x) (x) # define htoul(x) (x) # define htous(x) (x) # else -# if __BYTE_ORDER == __BIG_ENDIAN +# if OSMO_IS_BIG_ENDIAN # define utohl(x) __bswap_32 (x) # define utohs(x) __bswap_16 (x) # define htoul(x) __bswap_32 (x) |