Remvoed no longer needed version guards
This commit is contained in:
parent
c34c6a89cb
commit
a29b9e5efe
@ -59,9 +59,7 @@ defconstfunc(rb_mErrno)
|
|||||||
defconstfunc(rb_eException)
|
defconstfunc(rb_eException)
|
||||||
defconstfunc(rb_eFatal)
|
defconstfunc(rb_eFatal)
|
||||||
defconstfunc(rb_eFloatDomainError)
|
defconstfunc(rb_eFloatDomainError)
|
||||||
#ifdef RUBY_VERSION_IS_2_5
|
|
||||||
defconstfunc(rb_eFrozenError)
|
defconstfunc(rb_eFrozenError)
|
||||||
#endif
|
|
||||||
defconstfunc(rb_eIndexError)
|
defconstfunc(rb_eIndexError)
|
||||||
defconstfunc(rb_eInterrupt)
|
defconstfunc(rb_eInterrupt)
|
||||||
defconstfunc(rb_eIOError)
|
defconstfunc(rb_eIOError)
|
||||||
@ -144,9 +142,7 @@ void Init_constants_spec(void) {
|
|||||||
rb_define_method(cls, "rb_eException", constants_spec_rb_eException, 0);
|
rb_define_method(cls, "rb_eException", constants_spec_rb_eException, 0);
|
||||||
rb_define_method(cls, "rb_eFatal", constants_spec_rb_eFatal, 0);
|
rb_define_method(cls, "rb_eFatal", constants_spec_rb_eFatal, 0);
|
||||||
rb_define_method(cls, "rb_eFloatDomainError", constants_spec_rb_eFloatDomainError, 0);
|
rb_define_method(cls, "rb_eFloatDomainError", constants_spec_rb_eFloatDomainError, 0);
|
||||||
#ifdef RUBY_VERSION_IS_2_5
|
|
||||||
rb_define_method(cls, "rb_eFrozenError", constants_spec_rb_eFrozenError, 0);
|
rb_define_method(cls, "rb_eFrozenError", constants_spec_rb_eFrozenError, 0);
|
||||||
#endif
|
|
||||||
rb_define_method(cls, "rb_eIndexError", constants_spec_rb_eIndexError, 0);
|
rb_define_method(cls, "rb_eIndexError", constants_spec_rb_eIndexError, 0);
|
||||||
rb_define_method(cls, "rb_eInterrupt", constants_spec_rb_eInterrupt, 0);
|
rb_define_method(cls, "rb_eInterrupt", constants_spec_rb_eInterrupt, 0);
|
||||||
rb_define_method(cls, "rb_eIOError", constants_spec_rb_eIOError, 0);
|
rb_define_method(cls, "rb_eIOError", constants_spec_rb_eIOError, 0);
|
||||||
|
@ -34,14 +34,6 @@
|
|||||||
#define RUBY_VERSION_IS_2_6
|
#define RUBY_VERSION_IS_2_6
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if RUBY_VERSION_MAJOR > 2 || (RUBY_VERSION_MAJOR == 2 && RUBY_VERSION_MINOR >= 5)
|
|
||||||
#define RUBY_VERSION_IS_2_5
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if RUBY_VERSION_MAJOR > 2 || (RUBY_VERSION_MAJOR == 2 && RUBY_VERSION_MINOR >= 4)
|
|
||||||
#define RUBY_VERSION_IS_2_4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__cplusplus) && !defined(RUBY_VERSION_IS_2_7)
|
#if defined(__cplusplus) && !defined(RUBY_VERSION_IS_2_7)
|
||||||
/* Ruby < 2.7 needs this to let these function with callbacks and compile in C++ code */
|
/* Ruby < 2.7 needs this to let these function with callbacks and compile in C++ code */
|
||||||
#define rb_define_method(mod, name, func, argc) rb_define_method(mod, name, RUBY_METHOD_FUNC(func), argc)
|
#define rb_define_method(mod, name, func, argc) rb_define_method(mod, name, RUBY_METHOD_FUNC(func), argc)
|
||||||
|
@ -62,12 +62,10 @@ static VALUE struct_spec_rb_struct_new(VALUE self, VALUE klass,
|
|||||||
return rb_struct_new(klass, a, b, c);
|
return rb_struct_new(klass, a, b, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef RUBY_VERSION_IS_2_4
|
|
||||||
static VALUE struct_spec_rb_struct_size(VALUE self, VALUE st)
|
static VALUE struct_spec_rb_struct_size(VALUE self, VALUE st)
|
||||||
{
|
{
|
||||||
return rb_struct_size(st);
|
return rb_struct_size(st);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void Init_struct_spec(void) {
|
void Init_struct_spec(void) {
|
||||||
VALUE cls = rb_define_class("CApiStructSpecs", rb_cObject);
|
VALUE cls = rb_define_class("CApiStructSpecs", rb_cObject);
|
||||||
@ -79,9 +77,7 @@ void Init_struct_spec(void) {
|
|||||||
rb_define_method(cls, "rb_struct_define", struct_spec_struct_define, 4);
|
rb_define_method(cls, "rb_struct_define", struct_spec_struct_define, 4);
|
||||||
rb_define_method(cls, "rb_struct_define_under", struct_spec_struct_define_under, 5);
|
rb_define_method(cls, "rb_struct_define_under", struct_spec_struct_define_under, 5);
|
||||||
rb_define_method(cls, "rb_struct_new", struct_spec_rb_struct_new, 4);
|
rb_define_method(cls, "rb_struct_new", struct_spec_rb_struct_new, 4);
|
||||||
#ifdef RUBY_VERSION_IS_2_4
|
|
||||||
rb_define_method(cls, "rb_struct_size", struct_spec_rb_struct_size, 1);
|
rb_define_method(cls, "rb_struct_size", struct_spec_rb_struct_size, 1);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Loading…
x
Reference in New Issue
Block a user