summaryrefslogtreecommitdiff
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorAlessandro Gatti <a.gatti@frob.it>2025-01-15 16:25:55 +0100
committerDamien George <damien@micropython.org>2025-05-13 10:36:47 +1000
commitf47e214cdcf11c2067936cb4b4e4f9deab73f6fc (patch)
tree952d3ba600015817cd445f875c3072437951528d /py/mpconfig.h
parent69993daa5c2eae6055f0b3b2330e95e78d6e3738 (diff)
all: Rename the "NORETURN" macro to "MP_NORETURN".
This commit renames the NORETURN macro, indicating to the compiler that a function does not return, into MP_NORETURN to maintain the same naming convention of other similar macros. To maintain compaitiblity with existing code NORETURN is aliased to MP_NORETURN, but it is also deprecated for MicroPython v2. This changeset was created using a similar process to decf8e6a8bb940d5829ca3296790631fcece7b21 ("all: Remove the "STATIC" macro and just use "static" instead."), with no documentation or python scripts to change to reflect the new macro name. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r--py/mpconfig.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 9001b8983..49a9fa35c 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -2115,8 +2115,12 @@ typedef double mp_float_t;
#endif // INT_FMT
// Modifier for function which doesn't return
-#ifndef NORETURN
-#define NORETURN __attribute__((noreturn))
+#ifndef MP_NORETURN
+#define MP_NORETURN __attribute__((noreturn))
+#endif
+
+#if !MICROPY_PREVIEW_VERSION_2
+#define NORETURN MP_NORETURN
#endif
// Modifier for weak functions