From f2a21e91a0132976b44d408b1ecb15aeee52b478 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 14 Aug 2025 14:25:29 -0700 Subject: [PATCH] Fix a static assertion incompatible with C++98 --- include/ruby/internal/core/rtypeddata.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/ruby/internal/core/rtypeddata.h b/include/ruby/internal/core/rtypeddata.h index 9441b2f5c2b78a..4d9fd4a6acbde8 100644 --- a/include/ruby/internal/core/rtypeddata.h +++ b/include/ruby/internal/core/rtypeddata.h @@ -375,7 +375,9 @@ struct RTypedData { void *data; }; +#if !defined(__cplusplus) || __cplusplus >= 201103L RBIMPL_STATIC_ASSERT(data_in_rtypeddata, offsetof(struct RData, data) == offsetof(struct RTypedData, data)); +#endif RBIMPL_SYMBOL_EXPORT_BEGIN() RBIMPL_ATTR_NONNULL((3))