1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

win32/resolv.rb: check pointer size

* ext/win32/lib/win32/resolv.rb: check pointer size first, NT if
  it is larger than 4 as Windows 9X are 32-bit mode only.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-02-15 03:42:09 +00:00
parent 0f5a841881
commit 486f3f4270

View file

@ -35,14 +35,16 @@ module Win32
end
end
kernel32 = Module.new do
nt = Module.new do
break true if [nil].pack("p").size > 4
extend Importer
dlload "kernel32"
getv = extern "int GetVersionExA(void *)", :stdcall
info = [ 148, 0, 0, 0, 0 ].pack('V5') + "\0" * 128
getv.call(info)
break info.unpack('V5')[4] == 2 # VER_PLATFORM_WIN32_NT
end
getv = kernel32.extern "int GetVersionExA(void *)", :stdcall
info = [ 148, 0, 0, 0, 0 ].pack('V5') + "\0" * 128
getv.call(info)
if info.unpack('V5')[4] == 2 # VER_PLATFORM_WIN32_NT
if nt
#====================================================================
# Windows NT
#====================================================================