From be86373d37c432bf6286d691390056bfe852b081 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Sat, 6 Jan 2024 16:03:05 +0800 Subject: [PATCH] blisp_struct.h: define static_assert when undefined to _Static_assert --- include/blisp_struct.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/blisp_struct.h b/include/blisp_struct.h index 73694b9..bcf3992 100644 --- a/include/blisp_struct.h +++ b/include/blisp_struct.h @@ -9,6 +9,12 @@ #include #include +#if !defined(static_assert) && (defined(__GNUC__) || defined(__clang__)) \ + && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \ + && __STDC_VERSION__ <= 201710L +#define static_assert _Static_assert +#endif + #pragma pack(push, 1) typedef struct {