Skip to content

Commit ed7d4a8

Browse files
Fix rb_vm_bugreport signature for head
1 parent 422e8f6 commit ed7d4a8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ext/witapi/witapi-core.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <stdlib.h>
22

33
#include "ruby.h"
4+
#include "ruby/version.h"
45

56
// ========= Private Ruby API =========
67
// 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) {
323324
return (uint32_t)DATA_PTR(obj);
324325
}
325326

327+
_Static_assert(RUBY_API_VERSION_MAJOR == 3, "unsupported Ruby version");
328+
#if RUBY_API_VERSION_MINOR == 2
326329
void rb_vm_bugreport(const void *);
327330

328331
void rb_abi_guest_rb_vm_bugreport(void) { rb_vm_bugreport(NULL); }
332+
#elif RUBY_API_VERSION_MINOR == 3
333+
bool rb_vm_bugreport(const void *, FILE *);
334+
335+
void rb_abi_guest_rb_vm_bugreport(void) { rb_vm_bugreport(NULL, stderr); }
336+
#else
337+
# error "unsupported Ruby version"
338+
#endif
329339

330340
bool rb_abi_guest_rb_gc_enable(void) { return rb_gc_enable() == Qtrue; }
331341

0 commit comments

Comments
 (0)