Subject: Re: [ruby-ffi] FFI::Struct and struct stat |
From: Wayne Meissner |
Date: 5/21/10 3:10 AM |
To: ruby-ffi@googlegroups.com |
You should be able to do padding just by inserting fields of the correct type, the same as the C struct does. Declaring one struct to handle both 64bit and 32bit might be difficult, but this is ruby, so you can just choose which one you want at start time (based on the FFI::Platform info, perhaps), and then always use that one. On 19 May 2010 19:45, Christoph Kappel <unexist@dorfelite.net> wrote:
Hello, I am having some problems with creating a FFI::Struct for struct stat (usr/include/bits/stat.h), the problem is besides the many ifdefs related to x86/x86_64 the padding fields. I doubt that I can use the struct generator, because these padding fields are inside ifdefs too. Did anyone of you came across similar problems?