diff --git a/lib/childprocess/windows.rb b/lib/childprocess/windows.rb index 1470a7a..957c402 100644 --- a/lib/childprocess/windows.rb +++ b/lib/childprocess/windows.rb @@ -12,20 +12,12 @@ module Lib extend FFI::Library def self.msvcrt_name - host_part = RbConfig::CONFIG['host_os'].split("_")[1] - manifest = File.join(RbConfig::CONFIG['bindir'], 'ruby.exe.manifest') - - if host_part && host_part.to_i > 80 && File.exists?(manifest) - "msvcr#{host_part}" - else - "msvcrt" - end + RbConfig::CONFIG['RUBY_SO_NAME'][/msvc\w+/] || 'ucrtbase' end ffi_lib "kernel32", msvcrt_name ffi_convention :stdcall - end # Library end # Windows end # ChildProcess