diff options
author | Oliver Smith <osmith@sysmocom.de> | 2023-02-20 09:40:28 +0100 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2023-02-20 09:45:04 +0100 |
commit | 29baab4c582244349f9cd7ee67e4b29f31911802 (patch) | |
tree | 514d73de03127a3941d6ade1a0de608178452375 | |
parent | e0202abcc13896e2e1ff7d722e66320a154e2f65 (diff) |
Run struct_endianness.py
Use the OSMO_IS_LITTLE_ENDIAN / OSMO_IS_BIG_ENDIAN macros from
libosmocore and run struct_endianness.py to auto-generate the big endian
part.
Related: OS#5884
Change-Id: Ibeb96f61054b11ca9d82f8d9a00c3935ffb086a6
-rw-r--r-- | src/pq_rtp.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/pq_rtp.c b/src/pq_rtp.c index 3a09ba7..a5543a6 100644 --- a/src/pq_rtp.c +++ b/src/pq_rtp.c @@ -30,33 +30,21 @@ #include <osmocom/gapk/codecs.h> #include <osmocom/gapk/formats.h> #include <osmocom/gapk/procqueue.h> - -#ifndef __BYTE_ORDER -# ifdef __APPLE__ -# define __BYTE_ORDER __DARWIN_BYTE_ORDER -# define __LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN -# define __BIG_ENDIAN __DARWIN_BIG_ENDIAN -# else -# error "__BYTE_ORDER should be defined by someone" -# endif -#endif +#include <osmocom/core/endian.h> /* according to RFC 3550 */ struct rtp_hdr { -#if __BYTE_ORDER == __LITTLE_ENDIAN +#if OSMO_IS_LITTLE_ENDIAN uint8_t csrc_count:4, extension:1, padding:1, version:2; uint8_t payload_type:7, marker:1; -#elif __BYTE_ORDER == __BIG_ENDIAN - uint8_t version:2, - padding:1, - extension:1, - csrc_count:4; - uint8_t marker:1, - payload_type:7; +#elif OSMO_IS_BIG_ENDIAN +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ + uint8_t version:2, padding:1, extension:1, csrc_count:4; + uint8_t marker:1, payload_type:7; #endif uint16_t sequence; uint32_t timestamp; |