diff --git a/src/aja_common.cpp b/src/aja_common.cpp index 2e3c462a2..b84f5f86b 100644 --- a/src/aja_common.cpp +++ b/src/aja_common.cpp @@ -50,7 +50,7 @@ #include "aja_common.hpp" // include after color_out to override its stuff for MSVC #ifndef BYTE_SWAP -#ifdef WORDS_BIGENDIAN +#if !defined _MSC_VER && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ #define BYTE_SWAP(x) (3 - x) #else #define BYTE_SWAP(x) x diff --git a/src/libavcodec/from_lavc_vid_conv.c b/src/libavcodec/from_lavc_vid_conv.c index 6cf087640..2d1455f51 100644 --- a/src/libavcodec/from_lavc_vid_conv.c +++ b/src/libavcodec/from_lavc_vid_conv.c @@ -71,7 +71,7 @@ #define MOD_NAME "[from_lavc_vid_conv] " -#ifdef WORDS_BIGENDIAN +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ #define BYTE_SWAP(x) (3 - x) #else #define BYTE_SWAP(x) x diff --git a/src/libavcodec/to_lavc_vid_conv.c b/src/libavcodec/to_lavc_vid_conv.c index 672e8d6ee..1b5102990 100644 --- a/src/libavcodec/to_lavc_vid_conv.c +++ b/src/libavcodec/to_lavc_vid_conv.c @@ -66,7 +66,7 @@ #define MOD_NAME "[to_lavc_vid_conv] " -#ifdef WORDS_BIGENDIAN +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ #define BYTE_SWAP(x) (3 - x) #else #define BYTE_SWAP(x) x @@ -1152,12 +1152,6 @@ static void r10k_to_gbrp16le(AVFrame * __restrict out_frame, const unsigned char r10k_to_gbrpXXle(out_frame, in_data, width, height, 16U); } -#ifdef WORDS_BIGENDIAN -#define BYTE_SWAP(x) (3 - x) -#else -#define BYTE_SWAP(x) x -#endif - /// @note out_depth needs to be at least 12 #if defined __GNUC__ static inline void r12l_to_gbrpXXle(AVFrame * __restrict out_frame, const unsigned char * __restrict in_data, int width, int height, unsigned int out_depth) diff --git a/src/rtp/rtp.c b/src/rtp/rtp.c index 549e111c0..975e6e037 100644 --- a/src/rtp/rtp.c +++ b/src/rtp/rtp.c @@ -143,7 +143,7 @@ static void rtp_process_data(struct rtp *session, uint32_t curr_rtp_ts, #define RTCP_RX 205 typedef struct { -#ifdef WORDS_BIGENDIAN +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ unsigned short version:2; /* packet type */ unsigned short p:1; /* padding flag */ unsigned short count:5; /* varies by payload type */ diff --git a/src/utils/macros.h b/src/utils/macros.h index 0a3908c49..a8e2d559a 100644 --- a/src/utils/macros.h +++ b/src/utils/macros.h @@ -108,7 +108,7 @@ * Therefore, this is stored as a big endian even on little-endian architectures - first byte * of FourCC is in the memory on the lowest address. */ -#ifdef WORDS_BIGENDIAN +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ #define to_fourcc(a,b,c,d) (((uint32_t)(d)) | ((uint32_t)(c)<<8U) | ((uint32_t)(b)<<16U) | ((uint32_t)(a)<<24U)) #else #define to_fourcc(a,b,c,d) (((uint32_t)(a)) | ((uint32_t)(b)<<8U) | ((uint32_t)(c)<<16U) | ((uint32_t)(d)<<24U)) diff --git a/src/video_codec.c b/src/video_codec.c index c098eaa1c..40befca4f 100644 --- a/src/video_codec.c +++ b/src/video_codec.c @@ -79,12 +79,6 @@ char pixfmt_conv_pref[] = "dsc"; ///< bitdepth, subsampling, color space -#ifdef WORDS_BIGENDIAN -#define BYTE_SWAP(x) (3 - x) -#else -#define BYTE_SWAP(x) x -#endif - #ifdef __SSE2__ static void vc_deinterlace_aligned(unsigned char *src, long src_linesize, int lines); static void vc_deinterlace_unaligned(unsigned char *src, long src_linesize, int lines);