use RBIMPL_ATTR_MAYBE_UNUSED

The macro MAYBE_UNUSED, prepared by ./configure, may not be defined in
some environments such as Oracle Developer Studio 12.5 on Solaris 10.

This fixes [Bug #20963]
This commit is contained in:
Naohisa Goto 2024-12-18 23:37:22 +09:00
parent d07aa670b4
commit 528ec70604

View file

@ -23,6 +23,7 @@
#include <assert.h>
#include "ruby/internal/has/extension.h"
#include "ruby/internal/compiler_since.h"
#include "ruby/internal/attr/maybe_unused.h"
/** @cond INTERNAL_MACRO */
#if defined(__cplusplus) && defined(__cpp_static_assert)
@ -71,7 +72,7 @@
#else
# define RBIMPL_STATIC_ASSERT(name, expr) \
MAYBE_UNUSED(typedef int static_assert_ ## name ## _check[1 - 2 * !(expr)])
RBIMPL_ATTR_MAYBE_UNUSED() typedef int static_assert_ ## name ## _check[1 - 2 * !(expr)]
#endif
#endif /* RBIMPL_STATIC_ASSERT_H */