Skip to content

Commit

Permalink
sysdefs.h: Add alignas
Browse files Browse the repository at this point in the history
  • Loading branch information
Larhzu committed Jun 11, 2024
1 parent 0ed3a72 commit 55b8251
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/common/sysdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,17 @@ typedef unsigned char _Bool;
# define __bool_true_false_are_defined 1
#endif

// We may need alignas from C11/C17/C23.
#if __STDC_VERSION__ >= 202311
// alignas is a keyword in C23. Do nothing.
#elif __STDC_VERSION__ >= 201112
# include <stdalign.h>
#elif defined(__GNUC__) || defined(__clang__)
# define alignas(n) __attribute__((__aligned__(n)))
#else
# define alignas(n)
#endif

#include <string.h>

// Visual Studio 2013 update 2 supports only __inline, not inline.
Expand Down

0 comments on commit 55b8251

Please sign in to comment.