From ed7d4a86a5c2b58f50be07b0fb3517eac4ce3cae Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Sun, 12 Nov 2023 00:26:22 +0000 Subject: [PATCH] Fix rb_vm_bugreport signature for head --- ext/witapi/witapi-core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ext/witapi/witapi-core.c b/ext/witapi/witapi-core.c index 85b2361dd4..24b1b9b290 100644 --- a/ext/witapi/witapi-core.c +++ b/ext/witapi/witapi-core.c @@ -1,6 +1,7 @@ #include #include "ruby.h" +#include "ruby/version.h" // ========= Private Ruby API ========= // from eval_intern.h @@ -323,9 +324,18 @@ uint32_t rb_abi_guest_rb_abi_value_data_ptr(rb_abi_guest_rb_abi_value_t self) { return (uint32_t)DATA_PTR(obj); } +_Static_assert(RUBY_API_VERSION_MAJOR == 3, "unsupported Ruby version"); +#if RUBY_API_VERSION_MINOR == 2 void rb_vm_bugreport(const void *); void rb_abi_guest_rb_vm_bugreport(void) { rb_vm_bugreport(NULL); } +#elif RUBY_API_VERSION_MINOR == 3 +bool rb_vm_bugreport(const void *, FILE *); + +void rb_abi_guest_rb_vm_bugreport(void) { rb_vm_bugreport(NULL, stderr); } +#else +# error "unsupported Ruby version" +#endif bool rb_abi_guest_rb_gc_enable(void) { return rb_gc_enable() == Qtrue; }