From 4fca0ca666801c3ea3f977db1c36c3796f01ad41 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 10 Dec 2024 13:05:00 +0900 Subject: [PATCH] A workaround for JRuby to check for the target OS (Fix #69) Instead of checking for the existence of the necessary function. On JRuby no C compiler is available and this call results in a runtime error. --- ext/win32/resolv/extconf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/win32/resolv/extconf.rb b/ext/win32/resolv/extconf.rb index ac865ec..336f930 100644 --- a/ext/win32/resolv/extconf.rb +++ b/ext/win32/resolv/extconf.rb @@ -1,5 +1,5 @@ require 'mkmf' -if have_library('iphlpapi', 'GetNetworkParams') +if /cygwin|mingw|mswin/ =~ RbConfig::CONFIG['target_os'] create_makefile('win32/resolv') else File.write('Makefile', "all clean install:\n\t@echo Done: $(@)\n")