From 4bb1bfa0ed10a3a1e2ca04ada24d72e0227ebce7 Mon Sep 17 00:00:00 2001 From: ngoto Date: Fri, 30 Nov 2012 15:57:21 +0000 Subject: [PATCH] * ext/fiddle/extconf.rb, ext/fiddle/function.c (Fiddle::Function::STDCALL): FFI_STDCALL is not a macro, but an enumeration. [ruby-core:50398] [Bug #7483] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ ext/fiddle/extconf.rb | 2 ++ ext/fiddle/function.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 54922caca4..eb0245a5dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Dec 1 00:48:19 2012 Naohisa Goto + + * ext/fiddle/extconf.rb, ext/fiddle/function.c + (Fiddle::Function::STDCALL): FFI_STDCALL is not a macro, but an + enumeration. [ruby-core:50398] [Bug #7483] + Sat Dec 1 00:08:55 2012 NAKAMURA Usaku * test/rubygems/test_gem_installer.rb diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb index 9b9803f65b..2cb9ae0ace 100644 --- a/ext/fiddle/extconf.rb +++ b/ext/fiddle/extconf.rb @@ -33,6 +33,8 @@ elsif have_header "windows.h" end end +have_const('FFI_STDCALL', 'ffi.h') || have_const('FFI_STDCALL', 'ffi/ffi.h') + config = File.read(RbConfig.expand(File.join($arch_hdrdir, "ruby/config.h"))) types = {"SIZE_T"=>"SSIZE_T", "PTRDIFF_T"=>nil, "INTPTR_T"=>nil} types.each do |type, signed| diff --git a/ext/fiddle/function.c b/ext/fiddle/function.c index 4c4bc13abc..38012bfcbd 100644 --- a/ext/fiddle/function.c +++ b/ext/fiddle/function.c @@ -194,7 +194,7 @@ Init_fiddle_function(void) */ rb_define_const(cFiddleFunction, "DEFAULT", INT2NUM(FFI_DEFAULT_ABI)); -#ifdef FFI_STDCALL +#ifdef HAVE_CONST_FFI_STDCALL /* * Document-const: STDCALL *