diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb index cf8b5223bb85d5..2d85b3eea5215f 100644 --- a/ext/fiddle/extconf.rb +++ b/ext/fiddle/extconf.rb @@ -63,6 +63,11 @@ def enable_debug_build_flag(flags) end if have_ffi_header && (have_library('ffi') || have_library('libffi')) have_libffi = true + checking_for("undefined FFI_GO_CLOSURES is used") do + if egrep_cpp(/warning: 'FFI_GO_CLOSURES' is not defined/, cpp_include(ffi_header), "2>&1") + $defs.push('-DFFI_GO_CLOSURES=0') + end + end end end