aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Include/internal/pycore_code.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-09-06 15:52:07 +0200
committerGitHub <noreply@github.com>2024-09-06 15:52:07 +0200
commitef4b69d2becf49daaea21eb04effee81328a0393 (patch)
tree42d86e921b5008c6ae5d10cc09065e067dc8356b /Include/internal/pycore_code.h
parente95984826eb3cdb3a3baedb2ccea35e11e9f8161 (diff)
downloadcpython-ef4b69d2becf49daaea21eb04effee81328a0393.tar.gz
cpython-ef4b69d2becf49daaea21eb04effee81328a0393.zip
gh-123747: Avoid static_assert() in internal header files (#123779)
Diffstat (limited to 'Include/internal/pycore_code.h')
-rw-r--r--Include/internal/pycore_code.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h
index 112e880f924..57e0a14bb9b 100644
--- a/Include/internal/pycore_code.h
+++ b/Include/internal/pycore_code.h
@@ -543,8 +543,9 @@ write_location_entry_start(uint8_t *ptr, int code, int length)
#define ADAPTIVE_COOLDOWN_BACKOFF 0
// Can't assert this in pycore_backoff.h because of header order dependencies
-static_assert(SIDE_EXIT_INITIAL_VALUE > ADAPTIVE_COOLDOWN_VALUE,
- "Cold exit value should be larger than adaptive cooldown value");
+#if SIDE_EXIT_INITIAL_VALUE <= ADAPTIVE_COOLDOWN_VALUE
+# error "Cold exit value should be larger than adaptive cooldown value"
+#endif
static inline _Py_BackoffCounter
adaptive_counter_bits(uint16_t value, uint16_t backoff) {