Skip to content

Commit

Permalink
Improve Windows detection in extconf.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
jlnr committed Jan 18, 2015
1 parent 2eb6f89 commit b6e7396
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions ext/gosu/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env ruby

WINDOWS_HINTS = %w(-win32 win32- mswin mingw32)

if RUBY_PLATFORM =~ /mswin|mingw32|mingw64|win32\-|\-win32/ then
puts 'This gem is not meant to be installed on Windows. Instead, please use:'
puts 'gem install gosu --platform=i386-mingw32'
if RUBY_PLATFORM =~ /mswin$|mingw32|mingw64|win32\-|\-win32/ then
platform = (RUBY_PLATFORM =~ /^x64-/ ? 'x64-mingw32' : 'i386-mingw32')
puts "This gem is not meant to be installed on Windows. Instead, please use:"
puts "gem install gosu --platform=#{platform}"
exit 1
end

Expand Down
2 changes: 1 addition & 1 deletion lib/gosu.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rbconfig'

if RUBY_PLATFORM =~ /mswin$|mingw32|win32-|-win32/ then
if RUBY_PLATFORM =~ /mswin$|mingw32|mingw64|win32\-|\-win32/ then
binary_path = File.dirname(__FILE__)
# 64-bit builds of Windows use "x64-mingw32" as RUBY_PLATFORM
binary_path += '64' if RUBY_PLATFORM =~ /^x64-/
Expand Down

0 comments on commit b6e7396

Please sign in to comment.