Skip to content

Commit

Permalink
Python 3: Stop using undocumented PyLong_AS_LONG.
Browse files Browse the repository at this point in the history
Since zopefoundation/persistent#125 this would result in compiler warnings.

No change note, this is an internal change.

Fixes #131
  • Loading branch information
jamadden committed Mar 21, 2020
1 parent 3f3736b commit ab00035
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions BTrees/_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@
#define INTERN PyUnicode_InternFromString
#define INT_FROM_LONG(x) PyLong_FromLong(x)
#define INT_CHECK(x) PyLong_Check(x)
/* PyLong_AS_LONG isn't a documnted API function. But because of
* an issue in persistent/_compat.h, if we define it to be
* the documented function, PyLong_AsLong, we get
* warnings about macro redefinition. See
* https://github.com/zopefoundation/persistent/issues/125
*/
#define INT_AS_LONG(x) PyLong_AS_LONG(x)
#define INT_AS_LONG(x) PyLong_AsLong(x)
#define UINT_FROM_LONG(x) PyLong_FromUnsignedLong(x)
#define UINT_AS_LONG(x) PyLong_AsUnsignedLong(x)
#define TEXT_FROM_STRING PyUnicode_FromString
Expand Down

0 comments on commit ab00035

Please sign in to comment.