Skip to content

Commit

Permalink
Fix rb_vm_bugreport signature for head
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Nov 12, 2023
1 parent 422e8f6 commit ed7d4a8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ext/witapi/witapi-core.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <stdlib.h>

#include "ruby.h"
#include "ruby/version.h"

// ========= Private Ruby API =========
// from eval_intern.h
Expand Down Expand Up @@ -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; }

Expand Down

0 comments on commit ed7d4a8

Please sign in to comment.