Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyLong_AS_LONG is not documented #125

Closed
jamadden opened this issue Feb 14, 2020 · 0 comments · Fixed by #130
Closed

PyLong_AS_LONG is not documented #125

jamadden opened this issue Feb 14, 2020 · 0 comments · Fixed by #130
Assignees

Comments

@jamadden
Copy link
Member

Under Python 3, in _compat.h we define:

#define INT_AS_LONG(x) PyLong_AS_LONG(x)

But that's not a documented API. It is still defined by CPython, but just in terms of the documented API

#define PyLong_AS_LONG(op) PyLong_AsLong(op)

I propose changing to use the documented API.

@jamadden jamadden self-assigned this Feb 15, 2020
jamadden added a commit that referenced this issue Feb 20, 2020
Fixes #125

Because it was just an alias for the documented API, there should be no repercussions. The exception (and the reason for this issue in the first place) is if something both includes 'cPersistence.h' and also defines their own INT_AS_LONG macro. If the definitions differ, the compiler might now emit a warning. I saw that in BTrees https://github.com/zopefoundation/BTrees/pull/122/files#diff-277c29c35c8feb60719e5ec94a3fe72e
jamadden added a commit to zopefoundation/BTrees that referenced this issue Mar 21, 2020
Since zopefoundation/persistent#125 this would result in compiler warnings.

No change note, this is an internal change.

Fixes #131
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant