toolchain: Add flag indicating zero length array support

Add flag which indicates if a toolchain supports ZLA (Zero
Length Arrays). It is a GCCC extension inherited by clang as
well.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruściński 2023-09-11 09:53:06 +02:00 committed by Fabio Baltieri
parent c6fd21c5de
commit 1e7b540aa8
2 changed files with 10 additions and 0 deletions

View File

@ -115,6 +115,14 @@
#define TOOLCHAIN_HAS_C_AUTO_TYPE 0
#endif
/**
* @def TOOLCHAIN_HAS_ZLA
* @brief Indicate if toolchain supports Zero Length Arrays.
*/
#ifndef TOOLCHAIN_HAS_ZLA
#define TOOLCHAIN_HAS_ZLA 0
#endif
/**
* @def TOOLCHAIN_IGNORE_WSHADOW_BEGIN
* @brief Begin of block to ignore -Wshadow.

View File

@ -30,6 +30,8 @@
#define TOOLCHAIN_HAS_C_AUTO_TYPE 1
#endif
#define TOOLCHAIN_HAS_ZLA 1
/*
* Older versions of GCC do not define __BYTE_ORDER__, so it must be manually
* detected and defined using arch-specific definitions.