Skip to content

Commit

Permalink
Merge pull request #787 from larskanis/ffi_prep_closure_loc
Browse files Browse the repository at this point in the history
Test for ffi_prep_closure_loc() to make sure we can use this function
  • Loading branch information
larskanis committed Jun 5, 2020
2 parents 2c3979e + 440f336 commit 81dad3c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ext/ffi_c/extconf.rb
Expand Up @@ -13,18 +13,17 @@ def system_libffi_usable?
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi") ||
(find_header("ffi.h", `xcrun --sdk macosx --show-sdk-path`.strip + "/usr/include/ffi") rescue false)

# Ensure we can link to ffi_call
libffi_ok &&= have_library("ffi", "ffi_call", [ "ffi.h" ]) ||
have_library("libffi", "ffi_call", [ "ffi.h" ]) ||
have_library("libffi-8", "ffi_call", [ "ffi.h" ])
# Ensure we can link to ffi_prep_closure_loc
libffi_ok &&= have_library("ffi", "ffi_prep_closure_loc", [ "ffi.h" ]) ||
have_library("libffi", "ffi_prep_closure_loc", [ "ffi.h" ]) ||
have_library("libffi-8", "ffi_prep_closure_loc", [ "ffi.h" ])

if RbConfig::CONFIG['host_os'] =~ /mswin/
have_library('libffi_convenience')
have_library('shlwapi')
end

# And we need a libffi version recent enough to provide ffi_closure_alloc
libffi_ok &&= have_func("ffi_closure_alloc")
libffi_ok
end

dir_config("ffi_c")
Expand Down

0 comments on commit 81dad3c

Please sign in to comment.