1
0
Fork 0
forked from nuttx/nuttx-update

stddef.h: Add max_align_t typedef

defined by C11:
https://en.cppreference.com/w/c/types/max_align_t

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6f6094d054c475031ff83f648aa43f482d86b930
This commit is contained in:
Xiang Xiao 2020-05-27 11:48:36 +08:00 committed by patacongo
parent 3f88f57666
commit f90968ace4

View file

@ -99,4 +99,24 @@
* Reference: Opengroup.org
*/
/* Type whose alignment is supported in every context and is at least
* as great as that of any standard type not using alignment specifiers.
*/
typedef struct
{
#if defined(CONFIG_HAVE_LONG_LONG)
long long max_align_i;
#else
long max_align_i;
#endif
#if defined(CONFIG_HAVE_LONG_DOUBLE)
long double max_align_f;
#elif defined(CONFIG_HAVE_DOUBLE)
double max_align_f;
#elif defined(CONFIG_HAVE_FLOAT)
float max_align_f;
#endif
} max_align_t;
#endif /* __INCLUDE_STDDEF_H */