Skip to content

Commit

Permalink
Merge pull request #13 from ashie/support-ruby-3.1-ucrt
Browse files Browse the repository at this point in the history
Support Ruby 3.1 UCRT binary
  • Loading branch information
cosmo0920 committed Jun 9, 2022
2 parents a59b329 + 7dea4d9 commit 8b83e4b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ '2.5', '2.6', '2.7', '3.0' ]
ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1' ]
os:
- windows-latest
experimental: [false]
Expand Down
13 changes: 13 additions & 0 deletions appveyor.yml
Expand Up @@ -14,6 +14,7 @@ test_script:

environment:
matrix:
- ruby_version: "31-x64"
- ruby_version: "30-x64"
- ruby_version: "30"
- ruby_version: "27-x64"
Expand All @@ -32,3 +33,15 @@ environment:
- ruby_version: "21"
- ruby_version: "200-x64"
- ruby_version: "200"

for:
-
matrix:
only:
- ruby_version: "31-x64"
install:
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
- ruby --version
- gem --version
- ridk install 1 3
- ridk exec bundle install
4 changes: 3 additions & 1 deletion lib/windows/api.rb
Expand Up @@ -8,7 +8,9 @@ module Windows

# With Microsoft Visual C++ 8 and later users should use the associated
# DLL instead of msvcrt directly, if possible.
if CONFIG['host_os'].split('_')[1]
if RUBY_PLATFORM.split('-')[-1] == "ucrt"
MSVCRT_DLL = 'ucrtbase'
elsif CONFIG['host_os'].split('_')[1]
if CONFIG['host_os'].split('_')[1].to_i >= 80
MSVCRT_DLL = 'msvcr' + CONFIG['host_os'].split('_')[1]
else
Expand Down
2 changes: 1 addition & 1 deletion test/test_windows_api.rb
Expand Up @@ -53,7 +53,7 @@ class TC_Windows_API < Test::Unit::TestCase

def setup
@buf = 0.chr * 256
@runtimes = ['msvcrt', 'msvcr80', 'msvcr90', 'msvcr100']
@runtimes = ['msvcrt', 'msvcr80', 'msvcr90', 'msvcr100', 'ucrtbase']
end

def test_version
Expand Down

0 comments on commit 8b83e4b

Please sign in to comment.