diff --git a/lib/ffi/platform.rb b/lib/ffi/platform.rb index 959a72cff..ebc9d8b1c 100644 --- a/lib/ffi/platform.rb +++ b/lib/ffi/platform.rb @@ -129,7 +129,11 @@ def self.is_os(os) end LIBC = if IS_WINDOWS - "ucrtbase.dll" + if RbConfig::CONFIG['host_os'] =~ /mingw/i + RbConfig::CONFIG['RUBY_SO_NAME'].split('-')[-2] + '.dll' + else + "ucrtbase.dll" + end elsif IS_GNU GNU_LIBC elsif OS == 'cygwin'