Add support for Ruby 2.7
This commit fixes the signatures of various callback methods
and cleans up the macro definitions used for casting callbacks.
Note that the transparent version of the macro RUBY_METHOD_FUNC
is currently masked behind RUBY_DEVEL, see commit
1d91feaf13
In order to still support strict signature checking and prevent
nasty deprecation warnings, the use of RUBY_METHOD_FUNC had to
be replaced with VALUEFUNC.
This commit is contained in:
parent
9d1244c712
commit
00e291b319
5 changed files with 38 additions and 49 deletions
|
|
@ -32,7 +32,7 @@ extern "C" {
|
|||
*/
|
||||
static st_table* swig_ruby_trackings = NULL;
|
||||
|
||||
static VALUE swig_ruby_trackings_count(ANYARGS) {
|
||||
static VALUE swig_ruby_trackings_count(ID id, VALUE *var) {
|
||||
return SWIG2NUM(swig_ruby_trackings->num_entries);
|
||||
}
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
|
|||
swig_ruby_trackings = (st_table*)NUM2SWIG(trackings_value);
|
||||
}
|
||||
|
||||
rb_define_virtual_variable("SWIG_TRACKINGS_COUNT", swig_ruby_trackings_count, NULL);
|
||||
rb_define_virtual_variable("SWIG_TRACKINGS_COUNT", VALUEFUNC(swig_ruby_trackings_count), VOID_ANYARGS_FUNC((rb_gvar_setter_t*)NULL));
|
||||
}
|
||||
|
||||
/* Add a Tracking from a C/C++ struct to a Ruby object */
|
||||
|
|
@ -118,13 +118,13 @@ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
|
|||
to the passed callback function. */
|
||||
|
||||
/* Proxy method to abstract the internal trackings datatype */
|
||||
static int swig_ruby_internal_iterate_callback(void* ptr, VALUE obj, void(*meth)(void* ptr, VALUE obj)) {
|
||||
(*meth)(ptr, obj);
|
||||
static int swig_ruby_internal_iterate_callback(st_data_t ptr, st_data_t obj, st_data_t meth) {
|
||||
((void (*) (void *, VALUE))meth)((void *)ptr, (VALUE)obj);
|
||||
return ST_CONTINUE;
|
||||
}
|
||||
|
||||
SWIGRUNTIME void SWIG_RubyIterateTrackings( void(*meth)(void* ptr, VALUE obj) ) {
|
||||
st_foreach(swig_ruby_trackings, (int (*)(ANYARGS))&swig_ruby_internal_iterate_callback, (st_data_t)meth);
|
||||
st_foreach(swig_ruby_trackings, INT_ANYARGS_FUNC(swig_ruby_internal_iterate_callback), (st_data_t)meth);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue