ext/cumo/narray/gen/tmpl_bit/store_array.c in cumo-0.2.4 vs ext/cumo/narray/gen/tmpl_bit/store_array.c in cumo-0.2.5
- old
+ new
@@ -50,11 +50,15 @@
}
if (idx1) {
for (i=i1=0; i1<n1 && i<n; i++,i1++) {
x = ptr[i1];
- if (rb_obj_is_kind_of(x, rb_cRange) || rb_obj_is_kind_of(x, cumo_na_cStep)) {
+#ifdef HAVE_RB_ARITHMETIC_SEQUENCE_EXTRACT
+ if (rb_obj_is_kind_of(x, rb_cRange) || rb_obj_is_kind_of(x, rb_cArithSeq)) {
+#else
+ if (rb_obj_is_kind_of(x, rb_cRange) || rb_obj_is_kind_of(x, rb_cEnumerator)) {
+#endif
cumo_na_step_sequence(x,&len,&beg,&step);
for (c=0; c<len && i<n; c++,i++) {
y = beg + step * c;
z = m_from_double(y);
CUMO_STORE_BIT(a1, p1+*idx1, z); idx1++;
@@ -67,10 +71,14 @@
}
}
} else {
for (i=i1=0; i1<n1 && i<n; i++,i1++) {
x = ptr[i1];
- if (rb_obj_is_kind_of(x, rb_cRange) || rb_obj_is_kind_of(x, cumo_na_cStep)) {
+#ifdef HAVE_RB_ARITHMETIC_SEQUENCE_EXTRACT
+ if (rb_obj_is_kind_of(x, rb_cRange) || rb_obj_is_kind_of(x, rb_cArithSeq)) {
+#else
+ if (rb_obj_is_kind_of(x, rb_cRange) || rb_obj_is_kind_of(x, rb_cEnumerator)) {
+#endif
cumo_na_step_sequence(x,&len,&beg,&step);
for (c=0; c<len && i<n; c++,i++) {
y = beg + step * c;
z = m_from_double(y);
CUMO_STORE_BIT(a1, p1, z); p1+=s1;