gh-128629: Add Py_PACK_VERSION and Py_PACK_FULL_VERSION (GH-128630)

This commit is contained in:
Petr Viktorin
2025-01-09 11:10:28 +01:00
committed by GitHub
parent 4685401845
commit 1439b81928
18 changed files with 358 additions and 33 deletions

View File

@@ -648,3 +648,20 @@ PyModule_AddType(PyObject *module, PyTypeObject *type)
return PyModule_AddObjectRef(module, name, (PyObject *)type);
}
/* Exported functions for version helper macros */
#undef Py_PACK_FULL_VERSION
uint32_t
Py_PACK_FULL_VERSION(int x, int y, int z, int level, int serial)
{
return _Py_PACK_FULL_VERSION(x, y, z, level, serial);
}
#undef Py_PACK_VERSION
uint32_t
Py_PACK_VERSION(int x, int y)
{
return Py_PACK_FULL_VERSION(x, y, 0, 0, 0);
}