summaryrefslogtreecommitdiff
path: root/ext/fiddle/extconf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fiddle/extconf.rb')
-rw-r--r--ext/fiddle/extconf.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
index fce0cb4..915afb9 100644
--- a/ext/fiddle/extconf.rb
+++ b/ext/fiddle/extconf.rb
@@ -13,7 +13,7 @@ if ! bundle
if have_header(ffi_header = 'ffi.h')
true
elsif have_header(ffi_header = 'ffi/ffi.h')
- $defs.push(format('-DUSE_HEADER_HACKS'))
+ $defs.push('-DUSE_HEADER_HACKS')
true
end and (have_library('ffi') || have_library('libffi'))
end or
@@ -135,6 +135,7 @@ elsif have_header "windows.h"
end
have_const('FFI_STDCALL', ffi_header)
+have_func('ffi_closure_alloc', ffi_header)
config = File.read(RbConfig.expand(File.join($arch_hdrdir, "ruby/config.h")))
types = {"SIZE_T"=>"SSIZE_T", "PTRDIFF_T"=>nil, "INTPTR_T"=>nil}
@@ -142,7 +143,7 @@ types.each do |type, signed|
if /^\#define\s+SIZEOF_#{type}\s+(SIZEOF_(.+)|\d+)/ =~ config
if size = $2 and size != 'VOIDP'
size = types.fetch(size) {size}
- $defs << format("-DTYPE_%s=TYPE_%s", signed||type, size)
+ $defs << "-DTYPE_#{signed||type}=TYPE_#{size}"
end
if signed
check_signedness(type.downcase, "stddef.h")