fixes for mp_type_get_protocol_slot
This commit is contained in:
parent
566688b028
commit
556ec9d300
@ -31,7 +31,7 @@
|
|||||||
#ifndef MICROPY_UNSAFE_PROTO
|
#ifndef MICROPY_UNSAFE_PROTO
|
||||||
const void *mp_proto_get(uint16_t name, mp_const_obj_t obj) {
|
const void *mp_proto_get(uint16_t name, mp_const_obj_t obj) {
|
||||||
const mp_obj_type_t *type = mp_obj_get_type(obj);
|
const mp_obj_type_t *type = mp_obj_get_type(obj);
|
||||||
const void *protocol = mp_type_get_protocol_slot(type);
|
const void *protocol = MP_OBJ_TYPE_GET_SLOT_OR_NULL(type, protocol);
|
||||||
if (!protocol) {
|
if (!protocol) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#define MP_PROTOCOL_HEAD /* NOTHING */
|
#define MP_PROTOCOL_HEAD /* NOTHING */
|
||||||
#define MP_PROTO_IMPLEMENT(name) /* NOTHING */
|
#define MP_PROTO_IMPLEMENT(name) /* NOTHING */
|
||||||
static inline void *mp_proto_get(uint16_t name, mp_const_obj_type_t obj) {
|
static inline void *mp_proto_get(uint16_t name, mp_const_obj_type_t obj) {
|
||||||
return mp_type_get_protocol_slot(mp_obj_get_type(obj));
|
return MP_OBJ_TYPE_GET_SLOT_OR_NULL(mp_obj_get_type(obj), protocol);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define MP_PROTOCOL_HEAD \
|
#define MP_PROTOCOL_HEAD \
|
||||||
|
Loading…
Reference in New Issue
Block a user