From a9042ea21986a8ab6bb0d2b33ee6a3a2b8d925c1 Mon Sep 17 00:00:00 2001 From: arvinzzz Date: Mon, 26 Jul 2021 21:04:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=A8liteos=5Fa=E5=86=85=E6=A0=B8C?= =?UTF-8?q?=E5=BA=93=E4=B8=AD=E8=A1=A5=E5=85=85stdalign.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close: #I42FYJ Signed-off-by: arvinzzz Change-Id: I8365a057f8793ea35b03a0dfd95eae033ea9861a --- porting/liteos_a/kernel/include/stdalign.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 porting/liteos_a/kernel/include/stdalign.h diff --git a/porting/liteos_a/kernel/include/stdalign.h b/porting/liteos_a/kernel/include/stdalign.h new file mode 100644 index 00000000..13c70d23 --- /dev/null +++ b/porting/liteos_a/kernel/include/stdalign.h @@ -0,0 +1,22 @@ +#ifndef _STDALIGN_H +#define _STDALIGN_H + +#ifndef __cplusplus + +/* this whole header only works in C11 or with compiler extensions */ +#if __STDC_VERSION__ < 201112L && defined( __GNUC__) +#undef _Alignas +#define _Alignas(t) __attribute__((__aligned__(t))) +#undef _Alignof +#define _Alignof(t) __alignof__(t) +#endif + +#define alignas _Alignas +#define alignof _Alignof + +#endif + +#define __alignas_is_defined 1 +#define __alignof_is_defined 1 + +#endif -- GitLab