Skip to content

Add Py_PACK_VERSION macros #128629

@encukou

Description

@encukou

Add these to limited API:

  • Py_PACK_FULL_VERSION(x, y, z, level, serial): pack a version number from components
    into the format used by Py_VERSION_HEX and Py_LIMITED_API.
    For example, Py_PACK_FULL_VERSION(3, 14, 0, 0xA, 1) evaluates to 0x030E00A1.

  • Py_PACK_VERSION(x, y): shorthand for Py_PACK_FULL_VERSION(x, y, 0, 0, 0),
    useful because the first two version components often determine ABI
    compatibility.

These are primarily macros, but we will export library functions with the same names and functionality, for use in wrappers for non-C languages – for example, Python with ctypes.

The functions take int arguments and return uint32_t. Inputs are masked (high bits are ignored).

C API WG decision: capi-workgroup/decisions#47

Linked PRs

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy