Skip to content

Commit 9ed9d6d

Browse files
committed
Check for functions with arguments and the header
With arguments, mkmf skips compilation check for the function as RHS.
1 parent 5c64a5a commit 9ed9d6d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ext/zlib/extconf.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111
dir_config 'zlib'
1212

1313
libs = $libs
14-
if %w'z libz zlib1 zlib zdll zlibwapi'.find {|z| have_library(z, 'deflateReset')} and
15-
have_header('zlib.h') then
16-
have_zlib = true
17-
else
14+
have_zlib = %w'z libz zlib1 zlib zdll zlibwapi'.any? {|z| have_library(z, 'deflateReset(NULL)', 'zlib.h')}
15+
16+
unless have_zlib
1817
$libs = libs
1918
unless File.directory?(zsrc = "#{$srcdir}/zlib")
2019
dirs = Dir.open($srcdir) {|z| z.grep(/\Azlib-\d+[.\d]*\z/) {|x|"#{$srcdir}/#{x}"}}

0 commit comments

Comments
 (0)