File tree Expand file tree Collapse file tree
supervisor/shared/translate Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -297,7 +297,6 @@ typedef union _mp_float_union_t {
297297// So leave MP_COMPRESSED_ROM_TEXT in place for makeqstrdefs.py / makecompresseddata.py to find them.
298298
299299#else
300-
301300// Compression enabled and doing a regular build.
302301// Map MP_COMPRESSED_ROM_TEXT to the compressed strings.
303302
@@ -327,10 +326,9 @@ inline MP_ALWAYSINLINE const char *MP_COMPRESSED_ROM_TEXT(const char *msg) {
327326
328327 return msg ;
329328}
330-
331329#endif
332330
333- #elif CIRCUITPY
331+ #elif defined( CIRCUITPY )
334332#include "supervisor/shared/translate/translate.h"
335333#else
336334
@@ -339,6 +337,10 @@ inline MP_ALWAYSINLINE const char *MP_COMPRESSED_ROM_TEXT(const char *msg) {
339337typedef const char * mp_rom_error_text_t ;
340338#define MP_COMPRESSED_ROM_TEXT (x ) x
341339
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)
343345
344346#endif // MICROPY_INCLUDED_PY_MISC_H
Original file line number Diff line number Diff line change 9494typedef struct compressed_string {
9595 uint8_t data ;
9696 const uint8_t tail [];
97- } mp_rom_error_text_t ;
97+ } * mp_rom_error_text_t ;
9898
9999// Return the compressed, translated version of a source string
100100// Usually, due to LTO, this is optimized into a load of a constant
Original file line number Diff line number Diff line change 3333#include "supervisor/shared/translate/compressed_string.h"
3434
3535// 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)
3937
4038// translate() is a giant function with many strcmp calls. The assumption is
4139// 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