py: Rename MICROPY_SYS_EXIT to MICROPY_MOD_SYS_EXIT.

For consistency with MICROPY_MOD_SYS_STDFILES, etc.
This commit is contained in:
Damien George 2014-05-11 17:35:43 +01:00
parent f92a0d4d16
commit 89755ae67f
4 changed files with 13 additions and 13 deletions

View File

@ -36,11 +36,10 @@
#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,
// only addresses.
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_stdout_obj;
extern struct _dummy_t mp_sys_stderr_obj;
@ -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[] = {
{ 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_argv), (mp_obj_t)&mp_sys_argv_obj },
@ -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) },
#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
{ 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 },

View File

@ -235,13 +235,14 @@ typedef double mp_float_t;
#define MICROPY_ENABLE_MOD_SYS (1)
#endif
#ifndef MICROPY_MOD_SYS_STDFILES
#define MICROPY_MOD_SYS_STDFILES (0)
// sys.exit() availability
#ifndef MICROPY_MOD_SYS_EXIT
#define MICROPY_MOD_SYS_EXIT (0)
#endif
// sys.exit() availability
#ifndef MICROPY_SYS_EXIT
#define MICROPY_SYS_EXIT (0)
// sys.{stdin,stdout,stderr} availability
#ifndef MICROPY_MOD_SYS_STDFILES
#define MICROPY_MOD_SYS_STDFILES (0)
#endif
// Whether to support slice object and correspondingly

View File

@ -45,8 +45,8 @@
*/
#define MICROPY_ENABLE_LFN (1)
#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_SYS_EXIT (1)
#define MICROPY_ENABLE_MOD_CMATH (1)
// extra built in names to add to the global namespace

View File

@ -42,9 +42,9 @@
#define MICROPY_PATH_MAX (PATH_MAX)
#define MICROPY_STREAMS_NON_BLOCK (1)
#define MICROPY_USE_COMPUTED_GOTO (1)
#define MICROPY_MOD_SYS_EXIT (1)
#define MICROPY_MOD_SYS_STDFILES (1)
#define MICROPY_ENABLE_MOD_CMATH (1)
#define MICROPY_SYS_EXIT (1)
// Define to MICROPY_ERROR_REPORTING_DETAILED to get function, etc.
// names in exception messages (may require more RAM).
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED)