summaryrefslogtreecommitdiff
path: root/ext/fiddle/extconf.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-10 21:15:37 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-10 21:15:37 +0000
commita0f7f2921518443a60c807d272f0345aed61dc21 (patch)
treea1538a3ce800a4673b88087e2d330279a53533ec /ext/fiddle/extconf.rb
parentc607493e48c9f3dbf957a4bb5f0be2e8aa288442 (diff)
* ext/fiddle/extconf.rb: define RUBY_LIBFFI_MODVERSION macro.
* ext/fiddle/closure.c (USE_FFI_CLOSURE_ALLOC): define 0 or 1 with platform and libffi's version. [Bug #3371] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/fiddle/extconf.rb')
-rw-r--r--ext/fiddle/extconf.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
index 2cb9ae0ace..9c7991ec44 100644
--- a/ext/fiddle/extconf.rb
+++ b/ext/fiddle/extconf.rb
@@ -5,6 +5,10 @@ require 'mkmf'
dir_config 'libffi'
pkg_config("libffi")
+if ver = pkg_config("libffi", "modversion")
+ $defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d%03d' % ver.split('.') }})
+end
+
unless have_header('ffi.h')
if have_header('ffi/ffi.h')
$defs.push(format('-DUSE_HEADER_HACKS'))