kernel: Explicitly include toolchain.h to check for endianness definitions.

This commit adds an explicit inclusion of toolchain.h from kernel.h.

The endianness preprocessor definitions (__BYTE_ORDER__,
__ORDER_LITTLE_ENDIAN__, __ORDER_BIG_ENDIAN__) are used by kernel.h;
these being not defined can easily go unnoticed and cause unexpected
behaviours, as detailed in PR #18922.

toolchain.h ensures that these preprocessor definitions are defined
and *must* be included in a file that uses these definitions.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
Stephanos Ioannidis 2019-09-09 21:26:59 +09:00 committed by Carles Cufí
commit 33fbe002d0

View file

@ -17,6 +17,7 @@
#include <kernel_includes.h>
#include <errno.h>
#include <stdbool.h>
#include <toolchain.h>
#ifdef __cplusplus
extern "C" {