|
37 | 37 | /* Memory allocation policy */ |
38 | 38 |
|
39 | 39 | // Initial amount for lexer indentation level |
40 | | -#ifndef MP_ALLOC_LEXER_INDENT_INIT |
41 | | -#define MP_ALLOC_LEXER_INDENT_INIT (10) |
| 40 | +#ifndef MICROPY_ALLOC_LEXER_INDENT_INIT |
| 41 | +#define MICROPY_ALLOC_LEXER_INDENT_INIT (10) |
42 | 42 | #endif |
43 | 43 |
|
44 | 44 | // Increment for lexer indentation level |
45 | | -#ifndef MP_ALLOC_LEXEL_INDENT_INC |
46 | | -#define MP_ALLOC_LEXEL_INDENT_INC (8) |
| 45 | +#ifndef MICROPY_ALLOC_LEXEL_INDENT_INC |
| 46 | +#define MICROPY_ALLOC_LEXEL_INDENT_INC (8) |
47 | 47 | #endif |
48 | 48 |
|
49 | 49 | // Initial amount for parse rule stack |
50 | | -#ifndef MP_ALLOC_PARSE_RULE_INIT |
51 | | -#define MP_ALLOC_PARSE_RULE_INIT (64) |
| 50 | +#ifndef MICROPY_ALLOC_PARSE_RULE_INIT |
| 51 | +#define MICROPY_ALLOC_PARSE_RULE_INIT (64) |
52 | 52 | #endif |
53 | 53 |
|
54 | 54 | // Increment for parse rule stack |
55 | | -#ifndef MP_ALLOC_PARSE_RULE_INC |
56 | | -#define MP_ALLOC_PARSE_RULE_INC (16) |
| 55 | +#ifndef MICROPY_ALLOC_PARSE_RULE_INC |
| 56 | +#define MICROPY_ALLOC_PARSE_RULE_INC (16) |
57 | 57 | #endif |
58 | 58 |
|
59 | 59 | // Initial amount for parse result stack |
60 | | -#ifndef MP_ALLOC_PARSE_RESULT_INIT |
61 | | -#define MP_ALLOC_PARSE_RESULT_INIT (32) |
| 60 | +#ifndef MICROPY_ALLOC_PARSE_RESULT_INIT |
| 61 | +#define MICROPY_ALLOC_PARSE_RESULT_INIT (32) |
62 | 62 | #endif |
63 | 63 |
|
64 | 64 | // Increment for parse result stack |
65 | | -#ifndef MP_ALLOC_PARSE_RESULT_INC |
66 | | -#define MP_ALLOC_PARSE_RESULT_INC (16) |
| 65 | +#ifndef MICROPY_ALLOC_PARSE_RESULT_INC |
| 66 | +#define MICROPY_ALLOC_PARSE_RESULT_INC (16) |
67 | 67 | #endif |
68 | 68 |
|
69 | 69 | // Initial amount for ids in a scope |
70 | | -#ifndef MP_ALLOC_SCOPE_ID_INIT |
71 | | -#define MP_ALLOC_SCOPE_ID_INIT (4) |
| 70 | +#ifndef MICROPY_ALLOC_SCOPE_ID_INIT |
| 71 | +#define MICROPY_ALLOC_SCOPE_ID_INIT (4) |
72 | 72 | #endif |
73 | 73 |
|
74 | 74 | // Increment for ids in a scope |
75 | | -#ifndef MP_ALLOC_SCOPE_ID_INC |
76 | | -#define MP_ALLOC_SCOPE_ID_INC (6) |
| 75 | +#ifndef MICROPY_ALLOC_SCOPE_ID_INC |
| 76 | +#define MICROPY_ALLOC_SCOPE_ID_INC (6) |
| 77 | +#endif |
| 78 | + |
| 79 | +// Maximum length of a path in the filesystem |
| 80 | +// So we can allocate a buffer on the stack for path manipulation in import |
| 81 | +#ifndef MICROPY_ALLOC_PATH_MAX |
| 82 | +#define MICROPY_ALLOC_PATH_MAX (512) |
77 | 83 | #endif |
78 | 84 |
|
79 | 85 | /*****************************************************************************/ |
|
100 | 106 | #define MICROPY_EMIT_INLINE_THUMB (0) |
101 | 107 | #endif |
102 | 108 |
|
| 109 | +/*****************************************************************************/ |
| 110 | +/* Compiler configuration */ |
| 111 | + |
| 112 | +// Whether to enable constant optimisation; id = const(value) |
| 113 | +#ifndef MICROPY_COMP_CONST |
| 114 | +#define MICROPY_COMP_CONST (1) |
| 115 | +#endif |
| 116 | + |
103 | 117 | /*****************************************************************************/ |
104 | 118 | /* Internal debugging stuff */ |
105 | 119 |
|
|
119 | 133 | /*****************************************************************************/ |
120 | 134 | /* Fine control over Python features */ |
121 | 135 |
|
122 | | -// Whether to enable constant optimisation; id = const(value) |
123 | | -#ifndef MICROPY_ENABLE_CONST |
124 | | -#define MICROPY_ENABLE_CONST (1) |
125 | | -#endif |
126 | | - |
127 | 136 | // Whether to include the garbage collector |
128 | 137 | #ifndef MICROPY_ENABLE_GC |
129 | 138 | #define MICROPY_ENABLE_GC (0) |
|
135 | 144 | #endif |
136 | 145 |
|
137 | 146 | // Whether to include REPL helper function |
138 | | -#ifndef MICROPY_ENABLE_REPL_HELPERS |
139 | | -#define MICROPY_ENABLE_REPL_HELPERS (0) |
| 147 | +#ifndef MICROPY_HELPER_REPL |
| 148 | +#define MICROPY_HELPER_REPL (0) |
140 | 149 | #endif |
141 | 150 |
|
142 | 151 | // Whether to include lexer helper function for unix |
143 | | -#ifndef MICROPY_ENABLE_LEXER_UNIX |
144 | | -#define MICROPY_ENABLE_LEXER_UNIX (0) |
| 152 | +#ifndef MICROPY_HELPER_LEXER_UNIX |
| 153 | +#define MICROPY_HELPER_LEXER_UNIX (0) |
145 | 154 | #endif |
146 | 155 |
|
147 | 156 | // Long int implementation |
@@ -277,36 +286,33 @@ typedef double mp_float_t; |
277 | 286 | #define MICROPY_CPYTHON_COMPAT (1) |
278 | 287 | #endif |
279 | 288 |
|
280 | | -// Maximum length of a path in the filesystem |
281 | | -// So we can allocate a buffer on the stack for path manipulation in import |
282 | | -#ifndef MICROPY_PATH_MAX |
283 | | -#define MICROPY_PATH_MAX (512) |
284 | | -#endif |
285 | | - |
286 | 289 | // Whether POSIX-semantics non-blocking streams are supported |
287 | 290 | #ifndef MICROPY_STREAMS_NON_BLOCK |
288 | 291 | #define MICROPY_STREAMS_NON_BLOCK (0) |
289 | 292 | #endif |
290 | 293 |
|
291 | 294 | // Whether to use computed gotos in the VM, or a switch |
292 | 295 | // Computed gotos are roughly 10% faster, and increase VM code size by a little |
293 | | -#ifndef MICROPY_USE_COMPUTED_GOTO |
294 | | -#define MICROPY_USE_COMPUTED_GOTO (0) |
| 296 | +#ifndef MICROPY_OPT_COMPUTED_GOTO |
| 297 | +#define MICROPY_OPT_COMPUTED_GOTO (0) |
295 | 298 | #endif |
296 | 299 |
|
| 300 | +/*****************************************************************************/ |
| 301 | +/* Hooks for a port to add builtins */ |
| 302 | + |
297 | 303 | // Additional builtin function definitions - see builtintables.c:builtin_object_table for format. |
298 | | -#ifndef MICROPY_EXTRA_BUILTINS |
299 | | -#define MICROPY_EXTRA_BUILTINS |
| 304 | +#ifndef MICROPY_PORT_BUILTINS |
| 305 | +#define MICROPY_PORT_BUILTINS |
300 | 306 | #endif |
301 | 307 |
|
302 | 308 | // Additional builtin module definitions - see builtintables.c:builtin_module_table for format. |
303 | | -#ifndef MICROPY_EXTRA_BUILTIN_MODULES |
304 | | -#define MICROPY_EXTRA_BUILTIN_MODULES |
| 309 | +#ifndef MICROPY_PORT_BUILTIN_MODULES |
| 310 | +#define MICROPY_PORT_BUILTIN_MODULES |
305 | 311 | #endif |
306 | 312 |
|
307 | 313 | // Additional constant definitions for the compiler - see compile.c:mp_constants_table. |
308 | | -#ifndef MICROPY_EXTRA_CONSTANTS |
309 | | -#define MICROPY_EXTRA_CONSTANTS |
| 314 | +#ifndef MICROPY_PORT_CONSTANTS |
| 315 | +#define MICROPY_PORT_CONSTANTS |
310 | 316 | #endif |
311 | 317 |
|
312 | 318 | /*****************************************************************************/ |
|
0 commit comments