summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Kanis <lars@greiz-reinsdorf.de>2020-06-05 19:41:22 +0200
committerLars Kanis <lars@greiz-reinsdorf.de>2020-06-05 19:52:07 +0200
commitf2591397f92fe911257bef216b87bb2f233efb89 (patch)
treeeed5c7bbb1e1c2797883b0a3c4d89b97535ffca2
parent81dad3c38a8f217f5d9f305b5dddb43c6a09f0ee (diff)
downloadffi-f2591397f92fe911257bef216b87bb2f233efb89.tar.gz
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
-rw-r--r--lib/ffi/platform.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ffi/platform.rb b/lib/ffi/platform.rb
index 959a72c..ebc9d8b 100644
--- a/lib/ffi/platform.rb
+++ b/lib/ffi/platform.rb
@@ -129,7 +129,11 @@ module FFI
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'