Re: [PATCH] sbc: fix endian detection on arm-none-eabi

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Austin,

> The gcc-arm-none-eabi toolchain defines its byte order constants with a single
> preceding underscore rather than two.
> Additionally, the macros do not get defined unless <sys/param.h> is included.
> 
> Signed-off-by: Austin Morton <austinpmorton@xxxxxxxxx>
> ---
> sbc/sbc.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/sbc/sbc.c b/sbc/sbc.c
> index 606f11c..d3f5948 100644
> --- a/sbc/sbc.c
> +++ b/sbc/sbc.c
> @@ -35,6 +35,7 @@
> #include <stdlib.h>
> #include <stdbool.h>
> #include <sys/types.h>
> +#include <sys/param.h>
> #include <limits.h>
> 
> #include "sbc_math.h"
> @@ -70,7 +71,8 @@
> #define A2DP_ALLOCATION_SNR (1 << 1)
> #define A2DP_ALLOCATION_LOUDNESS (1 << 0)
> 
> -#if __BYTE_ORDER == __LITTLE_ENDIAN
> +#if (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) || \
> + (defined(_BYTE_ORDER) && _BYTE_ORDER == _LITTLE_ENDIAN)

while we can surely do this, I wonder why we need it. BlueZ is pretty old and has used the same ifdef for a long time. If this breaks in your toolchain, then it breaks in a lot of cases. So is this really the right fix or are we just missing some includes.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux