Skip to content

Commit 7fe886a

Browse files
committed
Fix mpy-cross and lto builds (again)
1 parent 8724b43 commit 7fe886a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

supervisor/shared/translate/translate.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
// Map MicroPython's error messages to our translations.
3535
#if !defined(MICROPY_ENABLE_DYNRUNTIME) || !MICROPY_ENABLE_DYNRUNTIME
3636
#include "supervisor/shared/translate/compressed_string.h"
37-
#define MP_COMPRESSED_ROM_TEXT(x) MP_ERROR_TEXT(x)
3837

3938
// MP_ERROR_TEXT() is a giant function with many strcmp calls. The assumption is
4039
// that the build process will optimize this away and replace it with the
@@ -48,7 +47,7 @@
4847
#else
4948
// In link time optimized (LTO) builds, we can compile this once into a .o and
5049
// at link time the calls will be optimized.
51-
mp_rom_error_text_t MP_ERROR_TEXT(const char *c);
50+
mp_rom_error_text_t MP_COMPRESSED_ROM_TEXT(const char *c);
5251
#endif
5352

5453
#else

supervisor/shared/translate/translate_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ __attribute__((always_inline))
5050
#endif
5151
// Prevent instrumenting this because that disables the inlining we rely of for code size
5252
// optimization.
53-
__attribute__((no_instrument_function)) mp_rom_error_text_t translate(const char *original) {
53+
__attribute__((no_instrument_function)) mp_rom_error_text_t MP_COMPRESSED_ROM_TEXT(const char *original) {
5454
#ifndef NO_QSTR
5555
#define QDEF(id, hash, len, str)
5656
#define TRANSLATION(english_id, number) if (strcmp(original, english_id) == 0) { return (mp_rom_error_text_t)&translation##number; } else

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy