diff options
| author | Damien George <damien@micropython.org> | 2023-10-13 17:37:56 +1100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-10-16 11:23:11 +1100 |
| commit | 9b63421fb36a9674eda01c1bc111f070b7b81329 (patch) | |
| tree | 2e55d9a23c17ff80ca7e539e7678d7138b54193e /py/dynruntime.h | |
| parent | 9c7ea9b14ac0378f580bd8ed55b22ef311eda20b (diff) | |
py/dynruntime: Add mp_get_buffer.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/dynruntime.h')
| -rw-r--r-- | py/dynruntime.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/py/dynruntime.h b/py/dynruntime.h index 90c401ab4..de9c93c65 100644 --- a/py/dynruntime.h +++ b/py/dynruntime.h @@ -125,7 +125,8 @@ static inline void *m_realloc_dyn(void *ptr, size_t new_num_bytes) { #define mp_obj_get_int_truncated(o) (mp_fun_table.native_from_obj(o, MP_NATIVE_TYPE_UINT)) #define mp_obj_str_get_str(s) (mp_obj_str_get_data_dyn((s), NULL)) #define mp_obj_str_get_data(o, len) (mp_obj_str_get_data_dyn((o), (len))) -#define mp_get_buffer_raise(o, bufinfo, fl) (mp_fun_table.get_buffer_raise((o), (bufinfo), (fl))) +#define mp_get_buffer(o, bufinfo, fl) (mp_fun_table.get_buffer((o), (bufinfo), (fl))) +#define mp_get_buffer_raise(o, bufinfo, fl) (mp_fun_table.get_buffer((o), (bufinfo), (fl) | MP_BUFFER_RAISE_IF_UNSUPPORTED)) #define mp_get_stream_raise(s, flags) (mp_fun_table.get_stream_raise((s), (flags))) #define mp_obj_is_true(o) (mp_fun_table.native_from_obj(o, MP_NATIVE_TYPE_BOOL)) |
