lib: os: cbprintf_packaged: update alignment for x86-32

The size of long double on x86-32 is 12 which is not
a power of 2, and this results in build error when it is
being used for alignment of buf32 in log_core.c.
So manually set it to 16.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2021-05-03 14:40:25 -07:00 committed by Anas Nashif
commit 16f5249b26

View file

@ -47,6 +47,13 @@ extern "C" {
/** @brief Required alignment of the buffer used for packaging. */
#ifdef __xtensa__
#define CBPRINTF_PACKAGE_ALIGNMENT 16
#elif defined(CONFIG_X86) && !defined(CONFIG_64BIT)
/* sizeof(long double) is 12 on x86-32, which is not power of 2.
* So set it manually.
*/
#define CBPRINTF_PACKAGE_ALIGNMENT \
(IS_ENABLED(CONFIG_CBPRINTF_PACKAGE_LONGDOUBLE) ? \
16 : MAX(sizeof(double), sizeof(long long)))
#else
#define CBPRINTF_PACKAGE_ALIGNMENT \
(IS_ENABLED(CONFIG_CBPRINTF_PACKAGE_LONGDOUBLE) ? \