From fc5989a1cec956a2f8aecc1dade57fa6814b0d39 Mon Sep 17 00:00:00 2001 From: Joel Low Date: Mon, 1 Dec 2014 09:19:02 +0800 Subject: Fix compatibility with newer libffi on Windows, if we are using a system-provided version) --- ext/ffi_c/extconf.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/ffi_c/extconf.rb b/ext/ffi_c/extconf.rb index b4d75b5..180634f 100644 --- a/ext/ffi_c/extconf.rb +++ b/ext/ffi_c/extconf.rb @@ -33,10 +33,11 @@ if !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx' $defs << "-DHAVE_EXTCONF_H" if $defs.empty? # needed so create_header works $defs << "-DUSE_INTERNAL_LIBFFI" unless libffi_ok $defs << "-DRUBY_1_9" if RUBY_VERSION >= "1.9.0" + $defs << "-DFFI_BUILDING" if RbConfig::CONFIG['host_os'] =~ /mswin/ # for compatibility with newer libffi create_header - $LOCAL_LIBS << " ./libffi/.libs/libffi_convenience.lib" if RbConfig::CONFIG['host_os'] =~ /mswin/ + $LOCAL_LIBS << " ./libffi/.libs/libffi_convenience.lib" if !libffi_ok && RbConfig::CONFIG['host_os'] =~ /mswin/ create_makefile("ffi_c") unless libffi_ok -- cgit v1.2.1