Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.17.0
-
None
-
None
Description
// We pass pointers as longs via the python interface, make sure this is safe. STATIC_ASSERT(sizeof(long) >= sizeof(void*), pointer_is_bigger_than_long);
This is wrong on Win64, where long is 4 bytes. There is multiple possible solutions:
- use long long, trivial workaround
- construct the python value explicitly, probably the nicest solution, and should not even add extra overhead
- use PyCapsules, not a good fit for existing code, requires changing signature in C on the callee side
and maybe even more possibilities. I am inclined to go with the PyLong_FromVoidPtr value constructor.