[Win32utils-devel] FFI and msvcrt

Daniel Berger djberg96 at gmail.com
Mon Jul 30 23:44:37 UTC 2012


Hi,

<snip>

>> I can find msvcrt runtime like this:
>>
>> def find_msvcrt
>> require 'rbconfig'
>> RbConfig::CONFIG['RUBY_SO_NAME'].split('-')[-2]+'.dll'
>> end
>>
>> Did you mean this seems ugly?
>>
>> Well, I cannot find a nicer method than above one.
>
> Ok, thanks. I thought maybe there was a better way.
>
> I've submitted a pull request: https://github.com/ffi/ffi/pull/199

Oops, I discovered that at least one company renamed it. Their
RUBY_SO_NAME value is the name of their company, which does not have a
hyphen in it.

How's this?

RbConfig::CONFIG['RUBY_SO_NAME'].split('-').first + '.dll'

Or was the -2 index significant?

Regards,

Dan


More information about the win32utils-devel mailing list