summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-03-05 11:31:08 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-03-05 11:31:08 +0900
commit261569d4aac440f25de588cca365163ecf1124a2 (patch)
treee8a76339544ec919595e9602583af7eb331314c9 /ext
parentf08cd708b11dd5b293986b92bb5e227731665b36 (diff)
[ruby/fiddle] always use ffi_closure_alloc on Windows
Diffstat (limited to 'ext')
-rw-r--r--ext/fiddle/extconf.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
index fae22e8..67ed080 100644
--- a/ext/fiddle/extconf.rb
+++ b/ext/fiddle/extconf.rb
@@ -116,7 +116,12 @@ if ver
ver = ver.gsub(/-rc\d+/, '') # If ver contains rc version, just ignored.
ver = (ver.split('.').map(&:to_i) + [0,0])[0,3]
$defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d%03d' % ver }})
- $defs << "-DUSE_FFI_CLOSURE_ALLOC=1" if (ver <=> [3, 2]) >= 0
+end
+
+warn "libffi_version: #{ver}"
+case
+when $mswin, $minor, (ver && (ver <=> [3, 2]) >= 0)
+ $defs << "-DUSE_FFI_CLOSURE_ALLOC=1"
end
have_header 'sys/mman.h'