Tidy up some configuration options.
MP_ALLOC_* -> MICROPY_ALLOC_*
MICROPY_PATH_MAX -> MICROPY_ALLOC_PATH_MAX
MICROPY_ENABLE_REPL_HELPERS -> MICROPY_HELPER_REPL
MICROPY_ENABLE_LEXER_UNIX -> MICROPY_HELPER_LEXER_UNIX
MICROPY_EXTRA_* -> MICROPY_PORT_*
See issue #35.
diff --git a/bare-arm/mpconfigport.h b/bare-arm/mpconfigport.h
index 4b54fa4..54e1171 100644
--- a/bare-arm/mpconfigport.h
+++ b/bare-arm/mpconfigport.h
@@ -2,14 +2,15 @@
// options to control how Micro Python is built
+#define MICROPY_ALLOC_PATH_MAX (512)
#define MICROPY_EMIT_X64 (0)
#define MICROPY_EMIT_THUMB (0)
#define MICROPY_EMIT_INLINE_THUMB (0)
#define MICROPY_MEM_STATS (0)
#define MICROPY_DEBUG_PRINTERS (0)
#define MICROPY_ENABLE_GC (0)
-#define MICROPY_ENABLE_REPL_HELPERS (0)
-#define MICROPY_ENABLE_LEXER_UNIX (0)
+#define MICROPY_HELPER_REPL (0)
+#define MICROPY_HELPER_LEXER_UNIX (0)
#define MICROPY_ENABLE_SOURCE_LINE (0)
#define MICROPY_ENABLE_MOD_COLLECTIONS (0)
#define MICROPY_ENABLE_MOD_MATH (0)
@@ -21,7 +22,6 @@
#define MICROPY_CPYTHON_COMPAT (0)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE)
-#define MICROPY_PATH_MAX (512)
// type definitions for the specific machine
@@ -37,6 +37,6 @@
// extra built in names to add to the global namespace
extern const struct _mp_obj_fun_native_t mp_builtin_open_obj;
-#define MICROPY_EXTRA_BUILTINS \
+#define MICROPY_PORT_BUILTINS \
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
diff --git a/py/builtinimport.c b/py/builtinimport.c
index e758158..d2b1870 100644
--- a/py/builtinimport.c
+++ b/py/builtinimport.c
@@ -278,7 +278,7 @@
DEBUG_printf("Module not yet loaded\n");
uint last = 0;
- VSTR_FIXED(path, MICROPY_PATH_MAX)
+ VSTR_FIXED(path, MICROPY_ALLOC_PATH_MAX)
module_obj = MP_OBJ_NULL;
mp_obj_t top_module_obj = MP_OBJ_NULL;
mp_obj_t outer_module_obj = MP_OBJ_NULL;
diff --git a/py/builtintables.c b/py/builtintables.c
index 133c14a..d51c019 100644
--- a/py/builtintables.c
+++ b/py/builtintables.c
@@ -140,7 +140,7 @@
// TODO: For MICROPY_CPYTHON_COMPAT==0 use ValueError to avoid exc proliferation
// Extra builtins as defined by a port
- MICROPY_EXTRA_BUILTINS
+ MICROPY_PORT_BUILTINS
};
const mp_obj_dict_t mp_builtin_object_dict_obj = {
@@ -183,7 +183,7 @@
#endif
// extra builtin modules as defined by a port
- MICROPY_EXTRA_BUILTIN_MODULES
+ MICROPY_PORT_BUILTIN_MODULES
};
const mp_obj_dict_t mp_builtin_module_dict_obj = {
diff --git a/py/compile.c b/py/compile.c
index cdd3a5b..0c43d93 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -104,7 +104,7 @@
STATIC const mp_map_elem_t mp_constants_table[] = {
// Extra constants as defined by a port
- MICROPY_EXTRA_CONSTANTS
+ MICROPY_PORT_CONSTANTS
};
STATIC const mp_map_t mp_constants_map = {
@@ -119,7 +119,7 @@
STATIC mp_parse_node_t fold_constants(compiler_t *comp, mp_parse_node_t pn, mp_map_t *consts) {
if (0) {
// dummy
-#if MICROPY_ENABLE_CONST
+#if MICROPY_COMP_CONST
} else if (MP_PARSE_NODE_IS_ID(pn)) {
// lookup identifier in table of dynamic constants
qstr qst = MP_PARSE_NODE_LEAF_ARG(pn);
@@ -133,7 +133,7 @@
// fold some parse nodes before folding their arguments
switch (MP_PARSE_NODE_STRUCT_KIND(pns)) {
-#if MICROPY_ENABLE_CONST
+#if MICROPY_COMP_CONST
case PN_expr_stmt:
if (!MP_PARSE_NODE_IS_NULL(pns->nodes[1])) {
mp_parse_node_struct_t *pns1 = (mp_parse_node_struct_t*)pns->nodes[1];
diff --git a/py/lexer.c b/py/lexer.c
index e2dfea7..42f755e 100644
--- a/py/lexer.c
+++ b/py/lexer.c
@@ -218,8 +218,8 @@
void indent_push(mp_lexer_t *lex, uint indent) {
if (lex->num_indent_level >= lex->alloc_indent_level) {
// TODO use m_renew_maybe and somehow indicate an error if it fails... probably by using MP_TOKEN_MEMORY_ERROR
- lex->indent_level = m_renew(uint16_t, lex->indent_level, lex->alloc_indent_level, lex->alloc_indent_level + MP_ALLOC_LEXEL_INDENT_INC);
- lex->alloc_indent_level += MP_ALLOC_LEXEL_INDENT_INC;
+ lex->indent_level = m_renew(uint16_t, lex->indent_level, lex->alloc_indent_level, lex->alloc_indent_level + MICROPY_ALLOC_LEXEL_INDENT_INC);
+ lex->alloc_indent_level += MICROPY_ALLOC_LEXEL_INDENT_INC;
}
lex->indent_level[lex->num_indent_level++] = indent;
}
@@ -731,7 +731,7 @@
lex->column = 1;
lex->emit_dent = 0;
lex->nested_bracket_level = 0;
- lex->alloc_indent_level = MP_ALLOC_LEXER_INDENT_INIT;
+ lex->alloc_indent_level = MICROPY_ALLOC_LEXER_INDENT_INIT;
lex->num_indent_level = 1;
lex->indent_level = m_new_maybe(uint16_t, lex->alloc_indent_level);
vstr_init(&lex->vstr, 32);
diff --git a/py/lexerunix.c b/py/lexerunix.c
index 4631cac..89dc80b 100644
--- a/py/lexerunix.c
+++ b/py/lexerunix.c
@@ -27,7 +27,7 @@
#include "misc.h"
#include "mpconfig.h"
-#if MICROPY_ENABLE_LEXER_UNIX
+#if MICROPY_HELPER_LEXER_UNIX
#include <stdio.h>
#include <unistd.h>
@@ -81,4 +81,4 @@
return mp_lexer_new(qstr_from_str(filename), fb, (mp_lexer_stream_next_char_t)file_buf_next_char, (mp_lexer_stream_close_t)file_buf_close);
}
-#endif // MICROPY_ENABLE_LEXER_UNIX
+#endif // MICROPY_HELPER_LEXER_UNIX
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 445fc78..5104f39 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -37,43 +37,49 @@
/* Memory allocation policy */
// Initial amount for lexer indentation level
-#ifndef MP_ALLOC_LEXER_INDENT_INIT
-#define MP_ALLOC_LEXER_INDENT_INIT (10)
+#ifndef MICROPY_ALLOC_LEXER_INDENT_INIT
+#define MICROPY_ALLOC_LEXER_INDENT_INIT (10)
#endif
// Increment for lexer indentation level
-#ifndef MP_ALLOC_LEXEL_INDENT_INC
-#define MP_ALLOC_LEXEL_INDENT_INC (8)
+#ifndef MICROPY_ALLOC_LEXEL_INDENT_INC
+#define MICROPY_ALLOC_LEXEL_INDENT_INC (8)
#endif
// Initial amount for parse rule stack
-#ifndef MP_ALLOC_PARSE_RULE_INIT
-#define MP_ALLOC_PARSE_RULE_INIT (64)
+#ifndef MICROPY_ALLOC_PARSE_RULE_INIT
+#define MICROPY_ALLOC_PARSE_RULE_INIT (64)
#endif
// Increment for parse rule stack
-#ifndef MP_ALLOC_PARSE_RULE_INC
-#define MP_ALLOC_PARSE_RULE_INC (16)
+#ifndef MICROPY_ALLOC_PARSE_RULE_INC
+#define MICROPY_ALLOC_PARSE_RULE_INC (16)
#endif
// Initial amount for parse result stack
-#ifndef MP_ALLOC_PARSE_RESULT_INIT
-#define MP_ALLOC_PARSE_RESULT_INIT (32)
+#ifndef MICROPY_ALLOC_PARSE_RESULT_INIT
+#define MICROPY_ALLOC_PARSE_RESULT_INIT (32)
#endif
// Increment for parse result stack
-#ifndef MP_ALLOC_PARSE_RESULT_INC
-#define MP_ALLOC_PARSE_RESULT_INC (16)
+#ifndef MICROPY_ALLOC_PARSE_RESULT_INC
+#define MICROPY_ALLOC_PARSE_RESULT_INC (16)
#endif
// Initial amount for ids in a scope
-#ifndef MP_ALLOC_SCOPE_ID_INIT
-#define MP_ALLOC_SCOPE_ID_INIT (4)
+#ifndef MICROPY_ALLOC_SCOPE_ID_INIT
+#define MICROPY_ALLOC_SCOPE_ID_INIT (4)
#endif
// Increment for ids in a scope
-#ifndef MP_ALLOC_SCOPE_ID_INC
-#define MP_ALLOC_SCOPE_ID_INC (6)
+#ifndef MICROPY_ALLOC_SCOPE_ID_INC
+#define MICROPY_ALLOC_SCOPE_ID_INC (6)
+#endif
+
+// Maximum length of a path in the filesystem
+// So we can allocate a buffer on the stack for path manipulation in import
+#ifndef MICROPY_ALLOC_PATH_MAX
+#define MICROPY_ALLOC_PATH_MAX (512)
#endif
/*****************************************************************************/
@@ -101,6 +107,14 @@
#endif
/*****************************************************************************/
+/* Compiler configuration */
+
+// Whether to enable constant optimisation; id = const(value)
+#ifndef MICROPY_COMP_CONST
+#define MICROPY_COMP_CONST (1)
+#endif
+
+/*****************************************************************************/
/* Internal debugging stuff */
// Whether to collect memory allocation stats
@@ -119,11 +133,6 @@
/*****************************************************************************/
/* Fine control over Python features */
-// Whether to enable constant optimisation; id = const(value)
-#ifndef MICROPY_ENABLE_CONST
-#define MICROPY_ENABLE_CONST (1)
-#endif
-
// Whether to include the garbage collector
#ifndef MICROPY_ENABLE_GC
#define MICROPY_ENABLE_GC (0)
@@ -135,13 +144,13 @@
#endif
// Whether to include REPL helper function
-#ifndef MICROPY_ENABLE_REPL_HELPERS
-#define MICROPY_ENABLE_REPL_HELPERS (0)
+#ifndef MICROPY_HELPER_REPL
+#define MICROPY_HELPER_REPL (0)
#endif
// Whether to include lexer helper function for unix
-#ifndef MICROPY_ENABLE_LEXER_UNIX
-#define MICROPY_ENABLE_LEXER_UNIX (0)
+#ifndef MICROPY_HELPER_LEXER_UNIX
+#define MICROPY_HELPER_LEXER_UNIX (0)
#endif
// Long int implementation
@@ -277,12 +286,6 @@
#define MICROPY_CPYTHON_COMPAT (1)
#endif
-// Maximum length of a path in the filesystem
-// So we can allocate a buffer on the stack for path manipulation in import
-#ifndef MICROPY_PATH_MAX
-#define MICROPY_PATH_MAX (512)
-#endif
-
// Whether POSIX-semantics non-blocking streams are supported
#ifndef MICROPY_STREAMS_NON_BLOCK
#define MICROPY_STREAMS_NON_BLOCK (0)
@@ -290,23 +293,26 @@
// Whether to use computed gotos in the VM, or a switch
// Computed gotos are roughly 10% faster, and increase VM code size by a little
-#ifndef MICROPY_USE_COMPUTED_GOTO
-#define MICROPY_USE_COMPUTED_GOTO (0)
+#ifndef MICROPY_OPT_COMPUTED_GOTO
+#define MICROPY_OPT_COMPUTED_GOTO (0)
#endif
+/*****************************************************************************/
+/* Hooks for a port to add builtins */
+
// Additional builtin function definitions - see builtintables.c:builtin_object_table for format.
-#ifndef MICROPY_EXTRA_BUILTINS
-#define MICROPY_EXTRA_BUILTINS
+#ifndef MICROPY_PORT_BUILTINS
+#define MICROPY_PORT_BUILTINS
#endif
// Additional builtin module definitions - see builtintables.c:builtin_module_table for format.
-#ifndef MICROPY_EXTRA_BUILTIN_MODULES
-#define MICROPY_EXTRA_BUILTIN_MODULES
+#ifndef MICROPY_PORT_BUILTIN_MODULES
+#define MICROPY_PORT_BUILTIN_MODULES
#endif
// Additional constant definitions for the compiler - see compile.c:mp_constants_table.
-#ifndef MICROPY_EXTRA_CONSTANTS
-#define MICROPY_EXTRA_CONSTANTS
+#ifndef MICROPY_PORT_CONSTANTS
+#define MICROPY_PORT_CONSTANTS
#endif
/*****************************************************************************/
diff --git a/py/parse.c b/py/parse.c
index f5efd7a..4bc78f1 100644
--- a/py/parse.c
+++ b/py/parse.c
@@ -134,13 +134,13 @@
return;
}
if (parser->rule_stack_top >= parser->rule_stack_alloc) {
- rule_stack_t *rs = m_renew_maybe(rule_stack_t, parser->rule_stack, parser->rule_stack_alloc, parser->rule_stack_alloc + MP_ALLOC_PARSE_RULE_INC);
+ rule_stack_t *rs = m_renew_maybe(rule_stack_t, parser->rule_stack, parser->rule_stack_alloc, parser->rule_stack_alloc + MICROPY_ALLOC_PARSE_RULE_INC);
if (rs == NULL) {
memory_error(parser);
return;
}
parser->rule_stack = rs;
- parser->rule_stack_alloc += MP_ALLOC_PARSE_RULE_INC;
+ parser->rule_stack_alloc += MICROPY_ALLOC_PARSE_RULE_INC;
}
rule_stack_t *rs = &parser->rule_stack[parser->rule_stack_top++];
rs->src_line = src_line;
@@ -263,13 +263,13 @@
return;
}
if (parser->result_stack_top >= parser->result_stack_alloc) {
- mp_parse_node_t *pn = m_renew_maybe(mp_parse_node_t, parser->result_stack, parser->result_stack_alloc, parser->result_stack_alloc + MP_ALLOC_PARSE_RESULT_INC);
+ mp_parse_node_t *pn = m_renew_maybe(mp_parse_node_t, parser->result_stack, parser->result_stack_alloc, parser->result_stack_alloc + MICROPY_ALLOC_PARSE_RESULT_INC);
if (pn == NULL) {
memory_error(parser);
return;
}
parser->result_stack = pn;
- parser->result_stack_alloc += MP_ALLOC_PARSE_RESULT_INC;
+ parser->result_stack_alloc += MICROPY_ALLOC_PARSE_RESULT_INC;
}
parser->result_stack[parser->result_stack_top++] = pn;
}
@@ -350,11 +350,11 @@
parser.had_memory_error = false;
- parser.rule_stack_alloc = MP_ALLOC_PARSE_RULE_INIT;
+ parser.rule_stack_alloc = MICROPY_ALLOC_PARSE_RULE_INIT;
parser.rule_stack_top = 0;
parser.rule_stack = m_new_maybe(rule_stack_t, parser.rule_stack_alloc);
- parser.result_stack_alloc = MP_ALLOC_PARSE_RESULT_INIT;
+ parser.result_stack_alloc = MICROPY_ALLOC_PARSE_RESULT_INIT;
parser.result_stack_top = 0;
parser.result_stack = m_new_maybe(mp_parse_node_t, parser.result_stack_alloc);
diff --git a/py/repl.c b/py/repl.c
index 4aff800..457ce16 100644
--- a/py/repl.c
+++ b/py/repl.c
@@ -28,7 +28,7 @@
#include "mpconfig.h"
#include "repl.h"
-#if MICROPY_ENABLE_REPL_HELPERS
+#if MICROPY_HELPER_REPL
bool str_startswith_word(const char *str, const char *head) {
int i;
@@ -107,4 +107,4 @@
return false;
}
-#endif // MICROPY_ENABLE_REPL_HELPERS
+#endif // MICROPY_HELPER_REPL
diff --git a/py/repl.h b/py/repl.h
index 36acfc3..92688f9 100644
--- a/py/repl.h
+++ b/py/repl.h
@@ -24,6 +24,6 @@
* THE SOFTWARE.
*/
-#if MICROPY_ENABLE_REPL_HELPERS
+#if MICROPY_HELPER_REPL
bool mp_repl_continue_with_input(const char *input);
#endif
diff --git a/py/scope.c b/py/scope.c
index ab29af7..839e821 100644
--- a/py/scope.c
+++ b/py/scope.c
@@ -71,7 +71,7 @@
}
scope->raw_code = mp_emit_glue_new_raw_code();
scope->emit_options = emit_options;
- scope->id_info_alloc = MP_ALLOC_SCOPE_ID_INIT;
+ scope->id_info_alloc = MICROPY_ALLOC_SCOPE_ID_INIT;
scope->id_info = m_new(id_info_t, scope->id_info_alloc);
return scope;
@@ -92,8 +92,8 @@
// make sure we have enough memory
if (scope->id_info_len >= scope->id_info_alloc) {
- scope->id_info = m_renew(id_info_t, scope->id_info, scope->id_info_alloc, scope->id_info_alloc + MP_ALLOC_SCOPE_ID_INC);
- scope->id_info_alloc += MP_ALLOC_SCOPE_ID_INC;
+ scope->id_info = m_renew(id_info_t, scope->id_info, scope->id_info_alloc, scope->id_info_alloc + MICROPY_ALLOC_SCOPE_ID_INC);
+ scope->id_info_alloc += MICROPY_ALLOC_SCOPE_ID_INC;
}
// add new id to end of array of all ids; this seems to match CPython
diff --git a/py/vm.c b/py/vm.c
index 123f520..ee2ec23 100644
--- a/py/vm.c
+++ b/py/vm.c
@@ -222,7 +222,7 @@
mp_obj_t *fastn, mp_obj_t **sp_in_out,
mp_exc_stack_t *exc_stack, mp_exc_stack_t **exc_sp_in_out,
volatile mp_obj_t inject_exc) {
-#if MICROPY_USE_COMPUTED_GOTO
+#if MICROPY_OPT_COMPUTED_GOTO
#include "vmentrytable.h"
#define DISPATCH() do { \
TRACE(ip); \
@@ -276,7 +276,7 @@
// loop to execute byte code
for (;;) {
dispatch_loop:
-#if MICROPY_USE_COMPUTED_GOTO
+#if MICROPY_OPT_COMPUTED_GOTO
DISPATCH();
#else
TRACE(ip);
@@ -982,7 +982,7 @@
fastn[0] = obj1;
return MP_VM_RETURN_EXCEPTION;
-#if !MICROPY_USE_COMPUTED_GOTO
+#if !MICROPY_OPT_COMPUTED_GOTO
} // switch
#endif
} // for loop
diff --git a/qemu-arm/mpconfigport.h b/qemu-arm/mpconfigport.h
index 76663cc..f760a47 100644
--- a/qemu-arm/mpconfigport.h
+++ b/qemu-arm/mpconfigport.h
@@ -2,18 +2,18 @@
// options to control how Micro Python is built
+#define MICROPY_ALLOC_PATH_MAX (512)
#define MICROPY_EMIT_X64 (0)
#define MICROPY_EMIT_THUMB (0)
#define MICROPY_EMIT_INLINE_THUMB (0)
#define MICROPY_MEM_STATS (0)
#define MICROPY_DEBUG_PRINTERS (0)
#define MICROPY_ENABLE_GC (0)
-#define MICROPY_ENABLE_REPL_HELPERS (0)
-#define MICROPY_ENABLE_LEXER_UNIX (0)
+#define MICROPY_HELPER_REPL (0)
+#define MICROPY_HELPER_LEXER_UNIX (0)
#define MICROPY_ENABLE_SOURCE_LINE (0)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE)
-#define MICROPY_PATH_MAX (512)
#define MICROPY_ENABLE_MOD_IO (0)
// type definitions for the specific machine
@@ -30,6 +30,6 @@
// extra built in names to add to the global namespace
extern const struct _mp_obj_fun_native_t mp_builtin_open_obj;
-#define MICROPY_EXTRA_BUILTINS \
+#define MICROPY_PORT_BUILTINS \
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h
index 59934b9..d10e314 100644
--- a/stmhal/mpconfigport.h
+++ b/stmhal/mpconfigport.h
@@ -26,17 +26,17 @@
// options to control how Micro Python is built
+#define MICROPY_ALLOC_PATH_MAX (128)
#define MICROPY_EMIT_THUMB (1)
#define MICROPY_EMIT_INLINE_THUMB (1)
#define MICROPY_ENABLE_GC (1)
#define MICROPY_ENABLE_FINALISER (1)
-#define MICROPY_ENABLE_REPL_HELPERS (1)
+#define MICROPY_HELPER_REPL (1)
#define MICROPY_ENABLE_SOURCE_LINE (1)
#define MICROPY_ENABLE_FROZENSET (1)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
-#define MICROPY_PATH_MAX (128)
-#define MICROPY_USE_COMPUTED_GOTO (1)
+#define MICROPY_OPT_COMPUTED_GOTO (1)
/* Enable FatFS LFNs
0: Disable LFN feature.
1: Enable LFN with static working buffer on the BSS. Always NOT reentrant.
@@ -53,7 +53,7 @@
extern const struct _mp_obj_fun_native_t mp_builtin_help_obj;
extern const struct _mp_obj_fun_native_t mp_builtin_input_obj;
extern const struct _mp_obj_fun_native_t mp_builtin_open_obj;
-#define MICROPY_EXTRA_BUILTINS \
+#define MICROPY_PORT_BUILTINS \
{ MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
@@ -63,14 +63,14 @@
extern const struct _mp_obj_module_t pyb_module;
extern const struct _mp_obj_module_t stm_module;
extern const struct _mp_obj_module_t time_module;
-#define MICROPY_EXTRA_BUILTIN_MODULES \
+#define MICROPY_PORT_BUILTIN_MODULES \
{ MP_OBJ_NEW_QSTR(MP_QSTR_os), (mp_obj_t)&os_module }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_pyb), (mp_obj_t)&pyb_module }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_stm), (mp_obj_t)&stm_module }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&time_module }, \
// extra constants
-#define MICROPY_EXTRA_CONSTANTS \
+#define MICROPY_PORT_CONSTANTS \
{ MP_OBJ_NEW_QSTR(MP_QSTR_pyb), (mp_obj_t)&pyb_module }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_stm), (mp_obj_t)&stm_module }, \
diff --git a/teensy/mpconfigport.h b/teensy/mpconfigport.h
index dfa46cc..c01f13a 100644
--- a/teensy/mpconfigport.h
+++ b/teensy/mpconfigport.h
@@ -5,7 +5,7 @@
#define MICROPY_EMIT_THUMB (1)
#define MICROPY_EMIT_INLINE_THUMB (1)
#define MICROPY_ENABLE_GC (1)
-#define MICROPY_ENABLE_REPL_HELPERS (1)
+#define MICROPY_HELPER_REPL (1)
#define MICROPY_ENABLE_FLOAT (1)
// type definitions for the specific machine
diff --git a/unix-cpy/mpconfigport.h b/unix-cpy/mpconfigport.h
index 1fc9e18..99b7358 100644
--- a/unix-cpy/mpconfigport.h
+++ b/unix-cpy/mpconfigport.h
@@ -27,7 +27,7 @@
// options to control how Micro Python is built
#define MICROPY_EMIT_CPYTHON (1)
-#define MICROPY_ENABLE_LEXER_UNIX (1)
+#define MICROPY_HELPER_LEXER_UNIX (1)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
#define MICROPY_ENABLE_MOD_IO (0)
diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h
index 6cac4f4..ec8989f 100644
--- a/unix/mpconfigport.h
+++ b/unix/mpconfigport.h
@@ -26,6 +26,7 @@
// options to control how Micro Python is built
+#define MICROPY_ALLOC_PATH_MAX (PATH_MAX)
#define MICROPY_EMIT_X64 (1)
#define MICROPY_EMIT_THUMB (0)
#define MICROPY_EMIT_INLINE_THUMB (0)
@@ -34,14 +35,13 @@
#define MICROPY_ENABLE_FROZENSET (1)
#define MICROPY_MEM_STATS (1)
#define MICROPY_DEBUG_PRINTERS (1)
-#define MICROPY_ENABLE_REPL_HELPERS (1)
-#define MICROPY_ENABLE_LEXER_UNIX (1)
+#define MICROPY_HELPER_REPL (1)
+#define MICROPY_HELPER_LEXER_UNIX (1)
#define MICROPY_ENABLE_SOURCE_LINE (1)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
-#define MICROPY_PATH_MAX (PATH_MAX)
#define MICROPY_STREAMS_NON_BLOCK (1)
-#define MICROPY_USE_COMPUTED_GOTO (1)
+#define MICROPY_OPT_COMPUTED_GOTO (1)
#define MICROPY_MOD_SYS_EXIT (1)
#define MICROPY_MOD_SYS_STDFILES (1)
#define MICROPY_ENABLE_MOD_CMATH (1)
@@ -66,7 +66,7 @@
#define MICROPY_MOD_TIME_DEF
#endif
-#define MICROPY_EXTRA_BUILTIN_MODULES \
+#define MICROPY_PORT_BUILTIN_MODULES \
MICROPY_MOD_FFI_DEF \
MICROPY_MOD_TIME_DEF \
{ MP_OBJ_NEW_QSTR(MP_QSTR_microsocket), (mp_obj_t)&mp_module_socket }, \
@@ -91,6 +91,6 @@
extern const struct _mp_obj_fun_native_t mp_builtin_input_obj;
extern const struct _mp_obj_fun_native_t mp_builtin_open_obj;
-#define MICROPY_EXTRA_BUILTINS \
+#define MICROPY_PORT_BUILTINS \
{ MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
diff --git a/windows/mpconfigport.h b/windows/mpconfigport.h
index 974c454..d6ab70b 100644
--- a/windows/mpconfigport.h
+++ b/windows/mpconfigport.h
@@ -31,14 +31,14 @@
#define MICROPY_USE_READLINE (0)
#endif
-#define MICROPY_PATH_MAX (260) //see minwindef.h for msvc or limits.h for mingw
+#define MICROPY_ALLOC_PATH_MAX (260) //see minwindef.h for msvc or limits.h for mingw
#define MICROPY_EMIT_X64 (0)
#define MICROPY_EMIT_THUMB (0)
#define MICROPY_EMIT_INLINE_THUMB (0)
#define MICROPY_MEM_STATS (1)
#define MICROPY_DEBUG_PRINTERS (1)
-#define MICROPY_ENABLE_REPL_HELPERS (1)
-#define MICROPY_ENABLE_LEXER_UNIX (1)
+#define MICROPY_HELPER_REPL (1)
+#define MICROPY_HELPER_LEXER_UNIX (1)
#define MICROPY_ENABLE_MOD_CMATH (1)
#define MICROPY_MOD_SYS_STDFILES (1)
#define MICROPY_MOD_SYS_EXIT (1)
@@ -69,11 +69,11 @@
typedef const void *machine_const_ptr_t; // must be of pointer size
extern const struct _mp_obj_fun_native_t mp_builtin_open_obj;
-#define MICROPY_EXTRA_BUILTINS \
+#define MICROPY_PORT_BUILTINS \
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
extern const struct _mp_obj_module_t mp_module_time;
-#define MICROPY_EXTRA_BUILTIN_MODULES \
+#define MICROPY_PORT_BUILTIN_MODULES \
{ MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&mp_module_time }, \
#include "realpath.h"
@@ -95,7 +95,7 @@
// CL specific overrides from mpconfig
#define NORETURN __declspec(noreturn)
-#define MICROPY_EXTRA_CONSTANTS { "dummy", 0 } //can't have zero-sized array
+#define MICROPY_PORT_CONSTANTS { "dummy", 0 } //can't have zero-sized array
// CL specific definitions