Skip to content

Commit 89755ae

Browse files
committed
py: Rename MICROPY_SYS_EXIT to MICROPY_MOD_SYS_EXIT.
For consistency with MICROPY_MOD_SYS_STDFILES, etc.
1 parent f92a0d4 commit 89755ae

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

py/modsys.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@
3636

3737
#if MICROPY_ENABLE_MOD_SYS
3838

39-
MP_DECLARE_CONST_FUN_OBJ(mp_sys_exit_obj);
40-
4139
// These should be implemented by ports, specific types don't matter,
4240
// only addresses.
4341
struct _dummy_t;
42+
extern struct _dummy_t mp_sys_exit_obj;
4443
extern struct _dummy_t mp_sys_stdin_obj;
4544
extern struct _dummy_t mp_sys_stdout_obj;
4645
extern struct _dummy_t mp_sys_stderr_obj;
@@ -55,10 +54,6 @@ STATIC const MP_DEFINE_STR_OBJ(version_obj, "3.4.0");
5554

5655
STATIC const mp_map_elem_t mp_module_sys_globals_table[] = {
5756
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_sys) },
58-
#if MICROPY_SYS_EXIT
59-
// Should be implemented by port
60-
{ MP_OBJ_NEW_QSTR(MP_QSTR_exit), (mp_obj_t)&mp_sys_exit_obj },
61-
#endif
6257

6358
{ MP_OBJ_NEW_QSTR(MP_QSTR_path), (mp_obj_t)&mp_sys_path_obj },
6459
{ MP_OBJ_NEW_QSTR(MP_QSTR_argv), (mp_obj_t)&mp_sys_argv_obj },
@@ -70,6 +65,10 @@ STATIC const mp_map_elem_t mp_module_sys_globals_table[] = {
7065
{ MP_OBJ_NEW_QSTR(MP_QSTR_byteorder), MP_OBJ_NEW_QSTR(MP_QSTR_big) },
7166
#endif
7267

68+
#if MICROPY_MOD_SYS_EXIT
69+
{ MP_OBJ_NEW_QSTR(MP_QSTR_exit), (mp_obj_t)&mp_sys_exit_obj },
70+
#endif
71+
7372
#if MICROPY_MOD_SYS_STDFILES
7473
{ MP_OBJ_NEW_QSTR(MP_QSTR_stdin), (mp_obj_t)&mp_sys_stdin_obj },
7574
{ MP_OBJ_NEW_QSTR(MP_QSTR_stdout), (mp_obj_t)&mp_sys_stdout_obj },

py/mpconfig.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,14 @@ typedef double mp_float_t;
235235
#define MICROPY_ENABLE_MOD_SYS (1)
236236
#endif
237237

238-
#ifndef MICROPY_MOD_SYS_STDFILES
239-
#define MICROPY_MOD_SYS_STDFILES (0)
238+
// sys.exit() availability
239+
#ifndef MICROPY_MOD_SYS_EXIT
240+
#define MICROPY_MOD_SYS_EXIT (0)
240241
#endif
241242

242-
// sys.exit() availability
243-
#ifndef MICROPY_SYS_EXIT
244-
#define MICROPY_SYS_EXIT (0)
243+
// sys.{stdin,stdout,stderr} availability
244+
#ifndef MICROPY_MOD_SYS_STDFILES
245+
#define MICROPY_MOD_SYS_STDFILES (0)
245246
#endif
246247

247248
// Whether to support slice object and correspondingly

stmhal/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
*/
4646
#define MICROPY_ENABLE_LFN (1)
4747
#define MICROPY_LFN_CODE_PAGE (437) /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
48+
#define MICROPY_MOD_SYS_EXIT (1)
4849
#define MICROPY_MOD_SYS_STDFILES (1)
49-
#define MICROPY_SYS_EXIT (1)
5050
#define MICROPY_ENABLE_MOD_CMATH (1)
5151

5252
// extra built in names to add to the global namespace

unix/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
#define MICROPY_PATH_MAX (PATH_MAX)
4343
#define MICROPY_STREAMS_NON_BLOCK (1)
4444
#define MICROPY_USE_COMPUTED_GOTO (1)
45+
#define MICROPY_MOD_SYS_EXIT (1)
4546
#define MICROPY_MOD_SYS_STDFILES (1)
4647
#define MICROPY_ENABLE_MOD_CMATH (1)
47-
#define MICROPY_SYS_EXIT (1)
4848
// Define to MICROPY_ERROR_REPORTING_DETAILED to get function, etc.
4949
// names in exception messages (may require more RAM).
5050
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED)

0 commit comments

Comments
 (0)