Skip to content

Commit 9b0714b

Browse files
committed
py: Declare help, input, open builtins in core.
These are *defined* per-port, but why redeclare them again and again.
1 parent 272fad6 commit 9b0714b

File tree

7 files changed

+4
-14
lines changed

7 files changed

+4
-14
lines changed

cc3200/mpconfigport.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@
114114
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (0)
115115

116116
// extra built in names to add to the global namespace
117-
extern const struct _mp_obj_fun_builtin_t mp_builtin_help_obj;
118-
extern const struct _mp_obj_fun_builtin_t mp_builtin_input_obj;
119-
extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
120117
#define MICROPY_PORT_BUILTINS \
121118
{ MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \
122119
{ MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \

esp8266/mpconfigport.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ typedef uint32_t sys_prot_t; // for modlwip
104104
#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
105105

106106
// extra built in names to add to the global namespace
107-
extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
108107
#define MICROPY_PORT_BUILTINS \
109108
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
110109

py/builtin.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ MP_DECLARE_CONST_FUN_OBJ(mp_builtin_repr_obj);
7171
MP_DECLARE_CONST_FUN_OBJ(mp_builtin_round_obj);
7272
MP_DECLARE_CONST_FUN_OBJ(mp_builtin_sorted_obj);
7373
MP_DECLARE_CONST_FUN_OBJ(mp_builtin_sum_obj);
74+
// Defined by a port, but declared here for simplicity
75+
MP_DECLARE_CONST_FUN_OBJ(mp_builtin_help_obj);
76+
MP_DECLARE_CONST_FUN_OBJ(mp_builtin_input_obj);
77+
MP_DECLARE_CONST_FUN_OBJ(mp_builtin_open_obj);
7478

7579
MP_DECLARE_CONST_FUN_OBJ(mp_namedtuple_obj);
7680

stmhal/mpconfigport.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@
9797
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (0)
9898

9999
// extra built in names to add to the global namespace
100-
extern const struct _mp_obj_fun_builtin_t mp_builtin_help_obj;
101-
extern const struct _mp_obj_fun_builtin_t mp_builtin_input_obj;
102-
extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
103100
#define MICROPY_PORT_BUILTINS \
104101
{ MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \
105102
{ MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \

teensy/mpconfigport.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (0)
2828

2929
// extra built in names to add to the global namespace
30-
extern const struct _mp_obj_fun_builtin_t mp_builtin_help_obj;
31-
extern const struct _mp_obj_fun_builtin_t mp_builtin_input_obj;
32-
extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
3330
#define MICROPY_PORT_BUILTINS \
3431
{ MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \
3532
{ MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \

unix/mpconfigport.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,6 @@ void mp_unix_mark_exec(void);
259259
#endif
260260
#endif
261261

262-
extern const struct _mp_obj_fun_builtin_t mp_builtin_input_obj;
263-
extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
264262
#define MICROPY_PORT_BUILTINS \
265263
{ MP_ROM_QSTR(MP_QSTR_input), MP_ROM_PTR(&mp_builtin_input_obj) }, \
266264
{ MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },

windows/mpconfigport.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ void mp_hal_dupterm_tx_strn(const char *str, size_t len);
149149
#define mp_hal_dupterm_tx_strn(s, l)
150150
#endif
151151

152-
extern const struct _mp_obj_fun_builtin_t mp_builtin_input_obj;
153-
extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
154152
#define MICROPY_PORT_BUILTINS \
155153
{ MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \
156154
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },

0 commit comments

Comments
 (0)