summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2021-02-20 17:41:08 -0600
committerJeff Epler <jepler@gmail.com>2021-02-20 17:41:08 -0600
commita04369e0f58623079bc6f1f33f847e5c08b2d587 (patch)
tree02fc3a623e1990aa2130d6b62528a72d857fb6d7 /py
parent1a3b12a3bcc460f29c9cb2a5ba5033bc63bfe0ce (diff)
add ifdef-guard
Diffstat (limited to 'py')
-rw-r--r--py/objarray.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/py/objarray.c b/py/objarray.c
index 50b87fb11..9640f596a 100644
--- a/py/objarray.c
+++ b/py/objarray.c
@@ -239,6 +239,7 @@ STATIC mp_obj_t memoryview_make_new(const mp_obj_type_t *type_in, size_t n_args,
return MP_OBJ_FROM_PTR(self);
}
+#if MICROPY_CPYTHON_COMPAT
STATIC mp_obj_t memoryview_cast(const mp_obj_t self_in, const mp_obj_t typecode_in) {
mp_obj_array_t *self = MP_OBJ_TO_PTR(self_in);
const char *typecode = mp_obj_str_get_str(typecode_in);
@@ -257,6 +258,7 @@ STATIC mp_obj_t memoryview_cast(const mp_obj_t self_in, const mp_obj_t typecode_
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(memoryview_cast_obj, memoryview_cast);
#endif
+#endif
STATIC mp_obj_t array_unary_op(mp_unary_op_t op, mp_obj_t o_in) {
mp_obj_array_t *o = MP_OBJ_TO_PTR(o_in);