summaryrefslogtreecommitdiff
path: root/extmod/modbtree.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-11-05 11:38:01 +1100
committerDamien George <damien.p.george@gmail.com>2019-12-12 20:15:28 +1100
commitbbeaafd9aa0378a4478b0e82d355bd0eee953c84 (patch)
tree33efc1182bbc044e052106e5ed3ac72afe595895 /extmod/modbtree.c
parente5acd06ad5b7cc144fb26d29baaa041ced065d45 (diff)
extmod: Add dynamic-runtime guards to btree/framebuf/uheapq/ure/uzlib.
So they can be built as dynamic native modules, as well as existing static native modules.
Diffstat (limited to 'extmod/modbtree.c')
-rw-r--r--extmod/modbtree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/extmod/modbtree.c b/extmod/modbtree.c
index 88129e210..a1d576fda 100644
--- a/extmod/modbtree.c
+++ b/extmod/modbtree.c
@@ -52,7 +52,9 @@ typedef struct _mp_obj_btree_t {
byte next_flags;
} mp_obj_btree_t;
+#if !MICROPY_ENABLE_DYNRUNTIME
STATIC const mp_obj_type_t btree_type;
+#endif
#define CHECK_ERROR(res) \
if (res == RET_ERROR) { \
@@ -295,6 +297,7 @@ STATIC mp_obj_t btree_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs
}
}
+#if !MICROPY_ENABLE_DYNRUNTIME
STATIC const mp_rom_map_elem_t btree_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&btree_close_obj) },
{ MP_ROM_QSTR(MP_QSTR_flush), MP_ROM_PTR(&btree_flush_obj) },
@@ -319,6 +322,7 @@ STATIC const mp_obj_type_t btree_type = {
.subscr = btree_subscr,
.locals_dict = (void*)&btree_locals_dict,
};
+#endif
STATIC const FILEVTABLE btree_stream_fvtable = {
mp_stream_posix_read,
@@ -327,6 +331,7 @@ STATIC const FILEVTABLE btree_stream_fvtable = {
mp_stream_posix_fsync
};
+#if !MICROPY_ENABLE_DYNRUNTIME
STATIC mp_obj_t mod_btree_open(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_flags, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} },
@@ -373,5 +378,6 @@ const mp_obj_module_t mp_module_btree = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&mp_module_btree_globals,
};
+#endif
#endif // MICROPY_PY_BTREE