Skip to content

Commit

Permalink
[ruby/fiddle] Suppress -Wundef warnings on arm64 macOS and Windows
Browse files Browse the repository at this point in the history
(ruby/fiddle#134)

```
In file included from ../../../../ext/fiddle/fiddle.h:46:
/opt/local/include/ffi.h:477:5: warning: 'FFI_GO_CLOSURES' is not defined, evaluates to 0 [-Wundef]
    ^
```

c.f. libffi/libffi#796

ruby/fiddle@d4feb57098
  • Loading branch information
nobu committed Sep 17, 2023
1 parent 72772a3 commit 5c94f3f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ext/fiddle/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5c94f3f

Please sign in to comment.