Skip to content

Commit

Permalink
Add __attribute__((unused)) to ZYAN_STATIC_ASSERT
Browse files Browse the repository at this point in the history
Fixes #81
  • Loading branch information
Alcaro authored and athre0z committed Feb 6, 2025
1 parent 7afed0e commit d2b47e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/Zycore/Defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@
(defined(__cplusplus) && defined (_MSC_VER) && (_MSC_VER >= 1600)) || \
(defined (_MSC_VER) && (_MSC_VER >= 1800))
# define ZYAN_STATIC_ASSERT(x) static_assert(x, #x)
#elif defined(ZYAN_GNUC)
# define ZYAN_STATIC_ASSERT(x) \
__attribute__((unused)) typedef int ZYAN_MACRO_CONCAT_EXPAND(ZYAN_SASSERT_, __COUNTER__) [(x) ? 1 : -1]
#else
# define ZYAN_STATIC_ASSERT(x) \
typedef int ZYAN_MACRO_CONCAT_EXPAND(ZYAN_SASSERT_, __COUNTER__) [(x) ? 1 : -1]
Expand Down

0 comments on commit d2b47e2

Please sign in to comment.