Commit 85edb9c
committed
Fix IAR compiler endianness detection in alignment.h
The IAR C/C++ compiler always defines both __LITTLE_ENDIAN__ and __BIG_ENDIAN__ macros internally, assigning '1' to the active endianness and '0' to the inactive one.
The previous check defined(__LITTLE_ENDIAN__) always evaluated to true on IAR, causing big-endian targets to be incorrectly treated as little-endian.
This commit updates the check to verify the value (__XXXX_ENDIAN__ == 1)
Signed-off-by: nzzlinh <dlinhvn@gmail.com>1 parent 8572c4a commit 85edb9c
2 files changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
| 403 | + | |
404 | 404 | | |
405 | 405 | | |
406 | | - | |
| 406 | + | |
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| |||
0 commit comments