Skip to content

Commit b103117

Browse files
committed
all: Adapt to MicroPython's removal of the STATIC macro
1 parent 1753b8b commit b103117

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

module.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,19 @@ static inline void dict_lookup(mp_obj_dict_t *src, qstr attr, mp_obj_t *dest) {
7171
* MP_REGISTER_ROOT_POINTER(mp_obj_dict_t mymodule_globals);
7272
*/
7373
#define UPYWRAP_DEFINE_ATTR_INIT_MODULE(name, initter) \
74-
STATIC void name##_module_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { \
74+
static void name##_module_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { \
7575
dict_lookup(&MP_STATE_VM(name##_globals), attr, dest); \
7676
}\
77-
STATIC mp_obj_t init_##name##_module() { \
77+
static mp_obj_t init_##name##_module() { \
7878
init_module_globals(&MP_STATE_VM(name##_globals), MP_QSTR_##name, initter); \
7979
return mp_const_none; \
8080
} \
81-
STATIC MP_DEFINE_CONST_FUN_OBJ_0(init_##name##_module_obj, init_##name##_module); \
82-
STATIC const mp_rom_map_elem_t name##_module_globals_table[] = { \
81+
static MP_DEFINE_CONST_FUN_OBJ_0(init_##name##_module_obj, init_##name##_module); \
82+
static const mp_rom_map_elem_t name##_module_globals_table[] = { \
8383
{ MP_ROM_QSTR(MP_QSTR___init__), MP_ROM_PTR(&init_##name##_module_obj) }, \
8484
MP_MODULE_ATTR_DELEGATION_ENTRY(&name##_module_attr), \
8585
}; \
86-
STATIC MP_DEFINE_CONST_DICT(name##_module_globals, name##_module_globals_table); \
86+
static MP_DEFINE_CONST_DICT(name##_module_globals, name##_module_globals_table); \
8787
const mp_obj_module_t name##_module = { \
8888
.base = { &mp_type_module }, \
8989
.globals = (mp_obj_dict_t *)&name##_module_globals, \
@@ -99,16 +99,16 @@ static inline void dict_lookup(mp_obj_dict_t *src, qstr attr, mp_obj_t *dest) {
9999
* MP_REGISTER_ROOT_POINTER(mp_obj_dict_t mymodule_globals);
100100
*/
101101
#define UPYWRAP_DEFINE_ATTR_MODULE(name, initter) \
102-
STATIC void name##_module_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { \
102+
static void name##_module_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { \
103103
if (MP_STATE_VM(name##_globals).map.table == NULL) { \
104104
init_module_globals(&MP_STATE_VM(name##_globals), MP_QSTR_##name, initter); \
105105
} \
106106
dict_lookup(&MP_STATE_VM(name##_globals), attr, dest); \
107107
}\
108-
STATIC const mp_rom_map_elem_t name##_module_globals_table[] = { \
108+
static const mp_rom_map_elem_t name##_module_globals_table[] = { \
109109
MP_MODULE_ATTR_DELEGATION_ENTRY(&name##_module_attr), \
110110
}; \
111-
STATIC MP_DEFINE_CONST_DICT(name##_module_globals, name##_module_globals_table); \
111+
static MP_DEFINE_CONST_DICT(name##_module_globals, name##_module_globals_table); \
112112
const mp_obj_module_t name##_module = { \
113113
.base = { &mp_type_module }, \
114114
.globals = (mp_obj_dict_t *)&name##_module_globals, \
@@ -124,12 +124,12 @@ static inline void dict_lookup(mp_obj_dict_t *src, qstr attr, mp_obj_t *dest) {
124124
*/
125125
#define UPYWRAP_DEFINE_INIT_MODULE(name, initter) \
126126
extern const struct _mp_obj_module_t name##_module; \
127-
STATIC mp_obj_t init_##name##_module() { \
127+
static mp_obj_t init_##name##_module() { \
128128
init_module_globals(name##_module.globals, MP_QSTR_##name, initter); \
129129
return mp_const_none; \
130130
} \
131-
STATIC MP_DEFINE_CONST_FUN_OBJ_0(init_##name##_module_obj, init_##name##_module); \
132-
STATIC mp_rom_map_elem_t name##_module_globals_table[] = { \
131+
static MP_DEFINE_CONST_FUN_OBJ_0(init_##name##_module_obj, init_##name##_module); \
132+
static mp_rom_map_elem_t name##_module_globals_table[] = { \
133133
{ MP_ROM_QSTR(MP_QSTR___init__), MP_ROM_PTR(&init_##name##_module_obj) } \
134134
}; \
135135
mp_obj_dict_t name##_module_globals = { \

0 commit comments

Comments
 (0)