Skip to content

Conversation

@arhadthedev
Copy link
Member

@arhadthedevarhadthedev commented Jul 29, 2022

This PR adds exports from the dll/so because all PyLong_* do so. However, if the core devs aren't against, I would prefer to transform them into inline macros (thus removing ABI churn and eliminating Misc/stable_abi.toml from the patch):

/* Include/longobject.h */staticuintptr_tPyLong_AsUintptr_t(PyObject *vv){return (uintptr_t)PyLong_AsVoidPtr(vv)} static PyObject * PyLong_FromUintptr_t(uintptr_t ival){returnPyLong_FromVoidPtr((void *)ival)}

Closesgh-95417.

cc @eryksun (who proposed to implement these functions).

@arhadthedev
Copy link
MemberAuthor

cc @benjaminp (from the object model interest area) because the new functions convert to/from PyLong_Type.

@arhadthedev
Copy link
MemberAuthor

According to https://devguide.python.org/developer-workflow/c-api/#guidelines-for-adding-to-the-limited-api, addition of stable ABI requires long discussion. I'm not ready for this for the sake of a single use case so closing this PR.

@arhadthedevarhadthedev deleted the pylong_asuintptr_t branch February 5, 2023 05:48
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

What way to choose to fix Warning: ULONG_PTR differs in levels of indirection from void * in AC-generated code?

2 participants

@arhadthedev@bedevere-bot