Automatically detect native endianness for IAR compiler platform. (#612)

* Auto detect native endianness for IAR compiler platform.

References:

- [IAR C/C++ Development Guide Compiling and Linking for Arm Limited’s **Arm**® Cores](https://wwwfiles.iar.com/arm/webic/doc/ewarm_developmentguide.enu.pdf)
- [IAR C/C++ Compiler User Guide for Microchip Technology’s **AVR** Microcontroller Family](https://wwwfiles.iar.com/AVR/webic/doc/EWAVR_CompilerGuide.pdf)

* Fix spelling mistake.
This commit is contained in:
David Hebbeker 2022-09-29 09:20:54 +02:00 committed by GitHub
parent 181a438287
commit d1e094476e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,9 +42,17 @@ SOFTWARE.
#endif
///\defgroup endian endian
/// Constants & utilities for endianess
/// Constants & utilities for endianness
///\ingroup utilities
#if !defined(ETL_ENDIAN_NATIVE) && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__)
#if __LITTLE_ENDIAN__ == 1
#define ETL_ENDIAN_NATIVE 0
#elif __LITTLE_ENDIAN__ == 0
#define ETL_ENDIAN_NATIVE 1
#endif
#endif
// Have we not already defined ETL_ENDIAN_NATIVE?
#if !defined(ETL_ENDIAN_NATIVE)
// Can we use the C++20 definitions?