nobu / ruby-lang.org wrote: > nobu 2014-07-21 16:04:21 +0900 (Mon, 21 Jul 2014) > > New Revision: 46892 > > http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46892 > > Log: > ruby/io.h: fix rb_io_buffer_t > > * include/ruby/io.h (rb_io_buffer_t): fix usage of PACKED_STRUCT(). > it must surround the whole declaration on VC. I tried that first, but GCC (4.7.2 on Debian) ignores the attribute if it surrounds typedef. I think splitting the struct definition and typedef is best: --- a/include/ruby/io.h +++ b/include/ruby/io.h @@ -51,12 +51,13 @@ extern "C" { RUBY_SYMBOL_EXPORT_BEGIN -PACKED_STRUCT(typedef struct { +PACKED_STRUCT(struct rb_io_buffer_t { char *ptr; /* off + len <= capa */ int off; int len; int capa; -} rb_io_buffer_t); +}); +typedef struct rb_io_buffer_t rb_io_buffer_t; typedef struct rb_io_t { FILE *stdio_file; /* stdio ptr for read/write if available */