lemire/fastrand

Python3 installation

Closed this issue · 2 comments

When installing for Python3.5, at import time it gives an error:

undefined symbol: PyInt_AsUnsignedLongLongMask

to solve it, I had to modify the .c file from:

#if PY_MAJOR_VERSION >= 3
#define PyInt_AsLong(x) PyLong_AsLong(x)
#endif

to

#if PY_MAJOR_VERSION >= 3
#define PyInt_AsLong(x) PyLong_AsLong(x)
#define PyInt_AsUnsignedLongLongMask(x) PyLong_AsUnsignedLongLongMask(x)
#endif

Do you want to issue this as a pull request?

One immediate benefit is that you get credit for your work.

Sure. Doing it.