ext/cumo/narray/array.c in cumo-0.2.4 vs ext/cumo/narray/array.c in cumo-0.2.5

- old
+ new

@@ -115,14 +115,16 @@ static int cumo_na_mdai_object_type(int type, VALUE v) { if (rb_obj_is_kind_of(v, rb_cRange)) { MDAI_ATTR_TYPE(type,v,begin); MDAI_ATTR_TYPE(type,v,end); - } else if (rb_obj_is_kind_of(v, cumo_na_cStep)) { +#ifdef HAVE_RB_ARITHMETIC_SEQUENCE_EXTRACT + } else if (rb_obj_is_kind_of(v, rb_cArithSeq)) { MDAI_ATTR_TYPE(type,v,begin); MDAI_ATTR_TYPE(type,v,end); MDAI_ATTR_TYPE(type,v,step); +#endif } else { type = cumo_na_object_type(type,v); } return type; } @@ -203,10 +205,14 @@ if ( cumo_na_mdai_investigate(mdai,ndim+1) ) { len--; /* Array is empty */ } } else - if (rb_obj_is_kind_of(v, rb_cRange) || rb_obj_is_kind_of(v, cumo_na_cStep)) { +#ifdef HAVE_RB_ARITHMETIC_SEQUENCE_EXTRACT + if (rb_obj_is_kind_of(v, rb_cRange) || rb_obj_is_kind_of(v, rb_cArithSeq)) { +#else + if (rb_obj_is_kind_of(v, rb_cRange) || rb_obj_is_kind_of(v, rb_cEnumerator)) { +#endif cumo_na_step_sequence(v,&length,&dbeg,&dstep); len += length-1; mdai->type = cumo_na_mdai_object_type(mdai->type, v); } else if (CumoIsNArray(v)) {