Skip to content

Commit

Permalink
STRUCT_ALIGNOF: use RUBY_ALIGNOF
Browse files Browse the repository at this point in the history
This was a workaround for RUBY_ALIGNOF's glitch, which has already been
fixed.  See also #3570
  • Loading branch information
shyouhei committed Oct 6, 2020
1 parent 7d59439 commit ae94c5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions ext/-test-/memory_view/memory_view.c
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions memory_view.c
Expand Up @@ -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;
Expand Down

0 comments on commit ae94c5b

Please sign in to comment.