[前][次][番号順一覧][スレッド一覧]

ruby-changes:60293

From: Nobuyoshi <ko1@a...>
Date: Wed, 4 Mar 2020 23:20:28 +0900 (JST)
Subject: [ruby-changes:60293] 528a3a1797 (master): [ruby/fiddle] use ffi_closure_alloc only with 3.2 or later

https://git.ruby-lang.org/ruby.git/commit/?id=528a3a1797

From 528a3a17977aa1843a26630c96635c3cb161e729 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 4 Mar 2020 23:13:45 +0900
Subject: [ruby/fiddle] use ffi_closure_alloc only with 3.2 or later


diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
index 2d0e188..fae22e8 100644
--- a/ext/fiddle/extconf.rb
+++ b/ext/fiddle/extconf.rb
@@ -114,8 +114,9 @@ end https://github.com/ruby/ruby/blob/trunk/ext/fiddle/extconf.rb#L114
 
 if ver
   ver = ver.gsub(/-rc\d+/, '') # If ver contains rc version, just ignored.
-  ver = (ver.split('.') + [0,0])[0,3]
+  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
 
 have_header 'sys/mman.h'
@@ -153,9 +154,6 @@ end https://github.com/ruby/ruby/blob/trunk/ext/fiddle/extconf.rb#L154
 if libffi
   $LOCAL_LIBS.prepend("./#{libffi.a} ").strip! # to exts.mk
   $INCFLAGS.gsub!(/-I#{libffi.dir}/, '-I$(LIBFFI_DIR)')
-  $defs << "-DUSE_FFI_CLOSURE_ALLOC=1"
-else
-  have_func('ffi_closure_alloc', ffi_header)
 end
 $INCFLAGS << " -I$(top_srcdir)"
 create_makefile 'fiddle' do |conf|
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]