xtensa: conditionally define endianness macros

__BYTE_ORDER__, __ORDER_BIG_ENDIAN__ and __ORDER_LITTLE_ENDIAN__ are not
defined when building with xcc, but are defined when building with gcc.
Define them conditionally.

Change-Id: Ib205ffee28360aa240d61731b7a3d6f45401b4c1
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
This commit is contained in:
Max Filippov 2017-02-15 14:18:13 -08:00 committed by Andrew Boie
commit ac430f9595

View file

@ -31,9 +31,15 @@ extern "C" {
* file machine/endian.h from XT_LIB defines similar ones. Thus we include it
* and define the missing macros ourselves.
*/
#ifndef __BYTE_ORDER__
#define __BYTE_ORDER__ XCHAL_MEMORY_ORDER
#endif
#ifndef __ORDER_BIG_ENDIAN__
#define __ORDER_BIG_ENDIAN__ XTHAL_BIGENDIAN
#endif
#ifndef __ORDER_LITTLE_ENDIAN__
#define __ORDER_LITTLE_ENDIAN__ XTHAL_LITTLEENDIAN
#endif
#define STACK_ALIGN 16
#define OCTET_TO_SIZEOFUNIT(X) (X)