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:
parent
7d594399f6
commit
ae94c5bf5d
Notes:
git
2020-10-06 14:20:34 +09:00
@ -2,8 +2,7 @@
|
|||||||
#include "ruby/memory_view.h"
|
#include "ruby/memory_view.h"
|
||||||
|
|
||||||
#define STRUCT_ALIGNOF(T, result) do { \
|
#define STRUCT_ALIGNOF(T, result) do { \
|
||||||
struct S { char _; T t; }; \
|
(result) = RUBY_ALIGNOF(T); \
|
||||||
(result) = (int)offsetof(struct S, t); \
|
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
static ID id_str;
|
static ID id_str;
|
||||||
|
@ -12,8 +12,7 @@
|
|||||||
#include "ruby/memory_view.h"
|
#include "ruby/memory_view.h"
|
||||||
|
|
||||||
#define STRUCT_ALIGNOF(T, result) do { \
|
#define STRUCT_ALIGNOF(T, result) do { \
|
||||||
struct S { char _; T t; }; \
|
(result) = RUBY_ALIGNOF(T); \
|
||||||
(result) = (int)offsetof(struct S, t); \
|
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
static ID id_memory_view;
|
static ID id_memory_view;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user