diff --git a/Include/internal/pycore_long.h b/Include/internal/pycore_long.h index 141839cf3415c9e..72589e4ec8b8205 100644 --- a/Include/internal/pycore_long.h +++ b/Include/internal/pycore_long.h @@ -222,25 +222,15 @@ PyAPI_FUNC(int) _PyLong_Size_t_Converter(PyObject *, void *); * 2: Reserved for immortality bit * 3+ Unsigned digit count */ -#define SIGN_MASK 3 +#define SIGN_MASK _PyLong_SIGN_MASK #define SIGN_ZERO 1 #define SIGN_NEGATIVE 2 -#define NON_SIZE_BITS 3 +#define NON_SIZE_BITS _PyLong_NON_SIZE_BITS -/* The functions _PyLong_IsCompact and _PyLong_CompactValue are defined - * in Include/cpython/longobject.h, since they need to be inline. - * - * "Compact" values have at least one bit to spare, +/* "Compact" values have at least one bit to spare, * so that addition and subtraction can be performed on the values * without risk of overflow. - * - * The inline functions need tag bits. - * For readability, rather than do `#define SIGN_MASK _PyLong_SIGN_MASK` - * we define them to the numbers in both places and then assert that - * they're the same. */ -static_assert(SIGN_MASK == _PyLong_SIGN_MASK, "SIGN_MASK does not match _PyLong_SIGN_MASK"); -static_assert(NON_SIZE_BITS == _PyLong_NON_SIZE_BITS, "NON_SIZE_BITS does not match _PyLong_NON_SIZE_BITS"); /* All *compact" values are guaranteed to fit into * a Py_ssize_t with at least one bit to spare.