File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
supervisor/shared/translate Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -297,7 +297,6 @@ typedef union _mp_float_union_t {
297
297
// So leave MP_COMPRESSED_ROM_TEXT in place for makeqstrdefs.py / makecompresseddata.py to find them.
298
298
299
299
#else
300
-
301
300
// Compression enabled and doing a regular build.
302
301
// Map MP_COMPRESSED_ROM_TEXT to the compressed strings.
303
302
@@ -327,10 +326,9 @@ inline MP_ALWAYSINLINE const char *MP_COMPRESSED_ROM_TEXT(const char *msg) {
327
326
328
327
return msg ;
329
328
}
330
-
331
329
#endif
332
330
333
- #elif CIRCUITPY
331
+ #elif defined( CIRCUITPY )
334
332
#include "supervisor/shared/translate/translate.h"
335
333
#else
336
334
@@ -339,6 +337,10 @@ inline MP_ALWAYSINLINE const char *MP_COMPRESSED_ROM_TEXT(const char *msg) {
339
337
typedef const char * mp_rom_error_text_t ;
340
338
#define MP_COMPRESSED_ROM_TEXT (x ) x
341
339
342
- #endif // MICROPY_ROM_TEXT_COMPRESSION // CIRCUITPY
340
+ #endif // MICROPY_ROM_TEXT_COMPRESSION
341
+
342
+ // Might add more types of compressed text in the future.
343
+ // For now, forward directly to MP_COMPRESSED_ROM_TEXT.
344
+ #define MP_ERROR_TEXT (x ) (mp_rom_error_text_t)MP_COMPRESSED_ROM_TEXT(x)
343
345
344
346
#endif // MICROPY_INCLUDED_PY_MISC_H
Original file line number Diff line number Diff line change 94
94
typedef struct compressed_string {
95
95
uint8_t data ;
96
96
const uint8_t tail [];
97
- } mp_rom_error_text_t ;
97
+ } * mp_rom_error_text_t ;
98
98
99
99
// Return the compressed, translated version of a source string
100
100
// Usually, due to LTO, this is optimized into a load of a constant
Original file line number Diff line number Diff line change 33
33
#include "supervisor/shared/translate/compressed_string.h"
34
34
35
35
// Map MicroPython's error messages to our translations.
36
- #if !defined(MICROPY_ENABLE_DYNRUNTIME ) || !MICROPY_ENABLE_DYNRUNTIME
37
- #define MP_ERROR_TEXT (x ) translate(x)
38
- #endif
36
+ #define MP_COMPRESSED_ROM_TEXT (x ) translate(x)
39
37
40
38
// translate() is a giant function with many strcmp calls. The assumption is
41
39
// that the build process will optimize this away and replace it with the
You can’t perform that action at this time.
0 commit comments