Commit 89755ae6 authored by Damien George's avatar Damien George
Browse files

py: Rename MICROPY_SYS_EXIT to MICROPY_MOD_SYS_EXIT.

For consistency with MICROPY_MOD_SYS_STDFILES, etc.
parent f92a0d4d
...@@ -36,11 +36,10 @@ ...@@ -36,11 +36,10 @@
#if MICROPY_ENABLE_MOD_SYS #if MICROPY_ENABLE_MOD_SYS
MP_DECLARE_CONST_FUN_OBJ(mp_sys_exit_obj);
// These should be implemented by ports, specific types don't matter, // These should be implemented by ports, specific types don't matter,
// only addresses. // only addresses.
struct _dummy_t; struct _dummy_t;
extern struct _dummy_t mp_sys_exit_obj;
extern struct _dummy_t mp_sys_stdin_obj; extern struct _dummy_t mp_sys_stdin_obj;
extern struct _dummy_t mp_sys_stdout_obj; extern struct _dummy_t mp_sys_stdout_obj;
extern struct _dummy_t mp_sys_stderr_obj; extern struct _dummy_t mp_sys_stderr_obj;
...@@ -55,10 +54,6 @@ STATIC const MP_DEFINE_STR_OBJ(version_obj, "3.4.0"); ...@@ -55,10 +54,6 @@ STATIC const MP_DEFINE_STR_OBJ(version_obj, "3.4.0");
STATIC const mp_map_elem_t mp_module_sys_globals_table[] = { STATIC const mp_map_elem_t mp_module_sys_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_sys) }, { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_sys) },
#if MICROPY_SYS_EXIT
// Should be implemented by port
{ MP_OBJ_NEW_QSTR(MP_QSTR_exit), (mp_obj_t)&mp_sys_exit_obj },
#endif
{ MP_OBJ_NEW_QSTR(MP_QSTR_path), (mp_obj_t)&mp_sys_path_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_path), (mp_obj_t)&mp_sys_path_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_argv), (mp_obj_t)&mp_sys_argv_obj }, { 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[] = { ...@@ -70,6 +65,10 @@ STATIC const mp_map_elem_t mp_module_sys_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_byteorder), MP_OBJ_NEW_QSTR(MP_QSTR_big) }, { MP_OBJ_NEW_QSTR(MP_QSTR_byteorder), MP_OBJ_NEW_QSTR(MP_QSTR_big) },
#endif #endif
#if MICROPY_MOD_SYS_EXIT
{ MP_OBJ_NEW_QSTR(MP_QSTR_exit), (mp_obj_t)&mp_sys_exit_obj },
#endif
#if MICROPY_MOD_SYS_STDFILES #if MICROPY_MOD_SYS_STDFILES
{ MP_OBJ_NEW_QSTR(MP_QSTR_stdin), (mp_obj_t)&mp_sys_stdin_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_stdin), (mp_obj_t)&mp_sys_stdin_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_stdout), (mp_obj_t)&mp_sys_stdout_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_stdout), (mp_obj_t)&mp_sys_stdout_obj },
......
...@@ -235,13 +235,14 @@ typedef double mp_float_t; ...@@ -235,13 +235,14 @@ typedef double mp_float_t;
#define MICROPY_ENABLE_MOD_SYS (1) #define MICROPY_ENABLE_MOD_SYS (1)
#endif #endif
#ifndef MICROPY_MOD_SYS_STDFILES // sys.exit() availability
#define MICROPY_MOD_SYS_STDFILES (0) #ifndef MICROPY_MOD_SYS_EXIT
#define MICROPY_MOD_SYS_EXIT (0)
#endif #endif
// sys.exit() availability // sys.{stdin,stdout,stderr} availability
#ifndef MICROPY_SYS_EXIT #ifndef MICROPY_MOD_SYS_STDFILES
#define MICROPY_SYS_EXIT (0) #define MICROPY_MOD_SYS_STDFILES (0)
#endif #endif
// Whether to support slice object and correspondingly // Whether to support slice object and correspondingly
......
...@@ -45,8 +45,8 @@ ...@@ -45,8 +45,8 @@
*/ */
#define MICROPY_ENABLE_LFN (1) #define MICROPY_ENABLE_LFN (1)
#define MICROPY_LFN_CODE_PAGE (437) /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */ #define MICROPY_LFN_CODE_PAGE (437) /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
#define MICROPY_MOD_SYS_EXIT (1)
#define MICROPY_MOD_SYS_STDFILES (1) #define MICROPY_MOD_SYS_STDFILES (1)
#define MICROPY_SYS_EXIT (1)
#define MICROPY_ENABLE_MOD_CMATH (1) #define MICROPY_ENABLE_MOD_CMATH (1)
// extra built in names to add to the global namespace // extra built in names to add to the global namespace
......
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
#define MICROPY_PATH_MAX (PATH_MAX) #define MICROPY_PATH_MAX (PATH_MAX)
#define MICROPY_STREAMS_NON_BLOCK (1) #define MICROPY_STREAMS_NON_BLOCK (1)
#define MICROPY_USE_COMPUTED_GOTO (1) #define MICROPY_USE_COMPUTED_GOTO (1)
#define MICROPY_MOD_SYS_EXIT (1)
#define MICROPY_MOD_SYS_STDFILES (1) #define MICROPY_MOD_SYS_STDFILES (1)
#define MICROPY_ENABLE_MOD_CMATH (1) #define MICROPY_ENABLE_MOD_CMATH (1)
#define MICROPY_SYS_EXIT (1)
// Define to MICROPY_ERROR_REPORTING_DETAILED to get function, etc. // Define to MICROPY_ERROR_REPORTING_DETAILED to get function, etc.
// names in exception messages (may require more RAM). // names in exception messages (may require more RAM).
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED) #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment