Skip to content

Commit

Permalink
Merge pull request #62 from barracuda156/static_assert
Browse files Browse the repository at this point in the history
blisp_struct.h: use _Static_assert for pre-C23 compatibility
  • Loading branch information
Ralim authored Dec 11, 2024
2 parents 108c387 + be86373 commit 17f6234
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/blisp_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
#include <assert.h>
#include <stdint.h>

#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 {
Expand Down

0 comments on commit 17f6234

Please sign in to comment.