1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
卜部昌平 2020-10-06 12:05:20 +09:00
parent 7d594399f6
commit ae94c5bf5d
Notes: git 2020-10-06 14:20:34 +09:00
2 changed files with 2 additions and 4 deletions

View file

@ -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;

View file

@ -12,8 +12,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_memory_view;