From 719e7e77a52d30146de3a95ee2b6baf69a11eb17 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Mon, 19 Jun 2023 12:34:07 +0100 Subject: [PATCH] [mypyc] Add Python 3.12 feature macro (#15465) It's currently unused but I have other PRs that will need this. We can later make this more general and support things like "are we running on Python 3.12 beta 2 or later", but this seems good enough for now. --- mypyc/lib-rt/mypyc_util.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mypyc/lib-rt/mypyc_util.h b/mypyc/lib-rt/mypyc_util.h index 13672087fbbc..3bc785ac6526 100644 --- a/mypyc/lib-rt/mypyc_util.h +++ b/mypyc/lib-rt/mypyc_util.h @@ -69,4 +69,7 @@ static inline CPyTagged CPyTagged_ShortFromSsize_t(Py_ssize_t x) { return x << 1; } +// Are we targeting Python 3.12 or newer? +#define CPY_3_12_FEATURES (PY_VERSION_HEX >= 0x030c0000) + #endif