summaryrefslogtreecommitdiff
path: root/ext/-test-/memory_view/memory_view.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-10-06 12:05:20 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-10-06 14:20:10 +0900
commitae94c5bf5d53b061659f9f08e1ee1b46d1447181 (patch)
treea79c3571b6c8b284f5fc9ffced7d9e876bd2a76a /ext/-test-/memory_view/memory_view.c
parent7d594399f666f35eff1c7be4ec944605dc9aa49c (diff)
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
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3631
Diffstat (limited to 'ext/-test-/memory_view/memory_view.c')
-rw-r--r--ext/-test-/memory_view/memory_view.c3
1 files changed, 1 insertions, 2 deletions
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;