diff --git a/src/misc.h b/src/misc.h index d77393f4..4a284031 100644 --- a/src/misc.h +++ b/src/misc.h @@ -59,6 +59,18 @@ net_is_http_or_https(const char *url); /* ----------------------- Conversion/hashing/sanitizers -------------------- */ +#ifdef HAVE_ENDIAN_H +# include +#elif defined(HAVE_SYS_ENDIAN_H) +# include +#elif defined(HAVE_LIBKERN_OSBYTEORDER_H) +#include +#define htobe16(x) OSSwapHostToBigInt16(x) +#define be16toh(x) OSSwapBigToHostInt16(x) +#define htobe32(x) OSSwapHostToBigInt32(x) +#define be32toh(x) OSSwapBigToHostInt32(x) +#endif + // Samples to bytes, bytes to samples #define STOB(s, bits, c) ((s) * (c) * (bits) / 8) #define BTOS(b, bits, c) ((b) / ((c) * (bits) / 8)) diff --git a/src/outputs/cast.c b/src/outputs/cast.c index 5ab22327..a4e8b843 100644 --- a/src/outputs/cast.c +++ b/src/outputs/cast.c @@ -32,15 +32,7 @@ #include #include #include -#ifdef HAVE_ENDIAN_H -# include -#elif defined(HAVE_SYS_ENDIAN_H) -# include -#elif defined(HAVE_LIBKERN_OSBYTEORDER_H) -#include -#define htobe32(x) OSSwapHostToBigInt32(x) -#define be32toh(x) OSSwapBigToHostInt32(x) -#endif + #include #include #include @@ -54,6 +46,7 @@ #include "outputs.h" #include "db.h" #include "artwork.h" +#include "misc.h" #ifdef HAVE_PROTOBUF_OLD #include "cast_channel.v0.pb-c.h" diff --git a/src/outputs/rtp_common.h b/src/outputs/rtp_common.h index d6ced5c7..0900157c 100644 --- a/src/outputs/rtp_common.h +++ b/src/outputs/rtp_common.h @@ -5,18 +5,6 @@ #include #include -#ifdef HAVE_ENDIAN_H -# include -#elif defined(HAVE_SYS_ENDIAN_H) -# include -#elif defined(HAVE_LIBKERN_OSBYTEORDER_H) -#include -#define htobe16(x) OSSwapHostToBigInt16(x) -#define be16toh(x) OSSwapBigToHostInt16(x) -#define htobe32(x) OSSwapHostToBigInt32(x) -#define be32toh(x) OSSwapBigToHostInt32(x) -#endif - struct rtcp_timestamp { uint32_t pos;