From: Jamis Buck Date: 2004-12-15T09:04:21+09:00 Subject: Re: 64-bit integers in Ruby/DL On 08:47 Wed 15 Dec , Florian Gross wrote: > Jamis Buck wrote: > > >Is there any way, without modifying Ruby/DL itself, to specify > >a function that returns a 64-bit integer using Ruby/DL? And to pass > >a 64-bit integer to a function? > > As far as I know Ruby/DL does not yet work properly on 64 bit platforms. > The author plans to fix that, but didn't have the time to do it when I > last contacted him. > > I think this would involve changes in lots of places because Ruby/DL > seems to be using one-byte type tokens and .pack() internally. However > if you want to use the native bit-width of the system you will need to > use "L_" instead of "L" and so on in the pack arguments. So I think this > would involve changing the semantics in quite a few code locations... Well, I'm actually on a 32-bit system. But gcc supports a 64-bit integer (long long), as does MSVC++. It's not critical, but it would certainly be nice. For now, I'm just using unsigned longs, which will lose the most significant 32 bits of each return value. :( - Jamis -- Jamis Buck jgb3@email.byu.edu http://www.jamisbuck.org/jamis