From f2591397f92fe911257bef216b87bb2f233efb89 Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Fri, 5 Jun 2020 19:41:22 +0200 Subject: [PATCH] Revert to msvcrt.dll as LIBC on MINGW ffi-1.13.0 switched FFI::Library::LIBC from msvcrt.dll to ucrtbase.dll as part of #779 in commit c67468366e63bcf84512837384049fbba7e4748c . As described in #788 ucrtbase.dll has behavioural changes which shouldn't be released as part of a minor version change of ffi. While the change makes sense for mswin, we revert it for mingw. Fixes #788 --- lib/ffi/platform.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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'