From ae94c5bf5d53b061659f9f08e1ee1b46d1447181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Tue, 6 Oct 2020 12:05:20 +0900 Subject: STRUCT_ALIGNOF: use RUBY_ALIGNOF This was a workaround for RUBY_ALIGNOF's glitch, which has already been fixed. See also https://github.com/ruby/ruby/pull/3570 --- ext/-test-/memory_view/memory_view.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ext/-test-/memory_view/memory_view.c') diff --git a/ext/-test-/memory_view/memory_view.c b/ext/-test-/memory_view/memory_view.c index ba7cbd9825..a59e7b872b 100644 --- a/ext/-test-/memory_view/memory_view.c +++ b/ext/-test-/memory_view/memory_view.c @@ -2,8 +2,7 @@ #include "ruby/memory_view.h" #define STRUCT_ALIGNOF(T, result) do { \ - struct S { char _; T t; }; \ - (result) = (int)offsetof(struct S, t); \ + (result) = RUBY_ALIGNOF(T); \ } while(0) static ID id_str; -- cgit v1.2.3