Skip to content

Commit 17f6234

Browse files
authored
Merge pull request #62 from barracuda156/static_assert
blisp_struct.h: use _Static_assert for pre-C23 compatibility
2 parents 108c387 + be86373 commit 17f6234

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

include/blisp_struct.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
#include <assert.h>
1010
#include <stdint.h>
1111

12+
#if !defined(static_assert) && (defined(__GNUC__) || defined(__clang__)) \
13+
&& defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
14+
&& __STDC_VERSION__ <= 201710L
15+
#define static_assert _Static_assert
16+
#endif
17+
1218
#pragma pack(push, 1)
1319

1420
typedef struct {

0 commit comments

Comments
 (0)