Fix deprecation warning on build with MRI>2.3
Fixes #158. The old alias is deprecated since: ruby/ruby@fdb957925f.
This commit is contained in:
parent
01e17ed5c6
commit
fde6a92197
|
@ -67,7 +67,7 @@ raiseRbExc(const Exception &exc);
|
|||
|
||||
/* 2.1 has added a new field (flags) to rb_data_type_t */
|
||||
#include <ruby/version.h>
|
||||
#if RUBY_API_VERSION_MINOR > 0
|
||||
#if RUBY_API_VERSION_MAJOR >= 2 && RUBY_API_VERSION_MINOR >= 1
|
||||
/* TODO: can mkxp use RUBY_TYPED_FREE_IMMEDIATELY here? */
|
||||
#define DEF_TYPE_FLAGS 0
|
||||
#else
|
||||
|
@ -90,7 +90,12 @@ raiseRbExc(const Exception &exc);
|
|||
template<rb_data_type_t *rbType>
|
||||
static VALUE classAllocate(VALUE klass)
|
||||
{
|
||||
/* 2.3 has changed the name of this function */
|
||||
#if RUBY_API_VERSION_MAJOR >= 2 && RUBY_API_VERSION_MINOR >= 3
|
||||
return rb_data_typed_object_wrap(klass, 0, rbType);
|
||||
#else
|
||||
return rb_data_typed_object_alloc(klass, 0, rbType);
|
||||
#endif
|
||||
}
|
||||
|
||||
template<class C>
|
||||
|
|
Loading…
Reference in New Issue