summaryrefslogtreecommitdiff
path: root/py/objexcept.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-04-13 14:52:10 +1000
committerDamien George <damien.p.george@gmail.com>2020-04-14 22:13:11 +1000
commit2725a791929f901c692d09f0afe7cc6a700384d5 (patch)
tree4c2942360d6ef0831158056538f84d8b7100abb0 /py/objexcept.c
parent5f0661b4fe6a68c38e9eecd94845f4bd1ed3046a (diff)
py: Always give noop defines when MICROPY_ROM_TEXT_COMPRESSION disabled.
This commit provides a typedef for mp_rom_error_text_t, and a macro define for MP_COMPRESSED_ROM_TEXT, when MICROPY_ROM_TEXT_COMPRESSION is disabled. This simplifies the configuration (it no longer has a special case for MICROPY_ENABLE_DYNRUNTIME) and makes it work for other cases that don't use compression (eg examples/embedding). This commit also ensures MICROPY_ROM_TEXT_COMPRESSION is defined during qstr processing.
Diffstat (limited to 'py/objexcept.c')
-rw-r--r--py/objexcept.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/py/objexcept.c b/py/objexcept.c
index 59a0557b1..517427ed7 100644
--- a/py/objexcept.c
+++ b/py/objexcept.c
@@ -38,8 +38,9 @@
#include "py/gc.h"
#include "py/mperrno.h"
-// Extract the MP_MAX_UNCOMPRESSED_TEXT_LEN macro from "genhdr/compressed.data.h"
-#if MICROPY_ROM_TEXT_COMPRESSION
+#if MICROPY_ROM_TEXT_COMPRESSION && !defined(NO_QSTR)
+// Extract the MP_MAX_UNCOMPRESSED_TEXT_LEN macro from "genhdr/compressed.data.h".
+// Only need this if compression enabled and in a regular build (i.e. not during QSTR extraction).
#define MP_MATCH_COMPRESSED(...) // Ignore
#define MP_COMPRESSED_DATA(...) // Ignore
#include "genhdr/compressed.data.h"