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:
parent
37de0c4987
commit
16f5249b26
1 changed files with 7 additions and 0 deletions
|
@ -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) ? \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue