The test_pass_pointer and test_int_pointer_arg tests are inconsistent between 32-bit and 64-bit builds because c_long is always 32 bits but the function being called may return a 64-bit value (it's a pointer, so c_long may truncate it). I'd prefer to have a c_intptr type to use, but this patch uses c_longlong in the test if that's the size of a pointer. Just looking for a quick review so I can check this into default. Not sure why it doesn't repro with VC10, but it certainly does with later compilers.
> Why not use c_size_t? Or is that incorrect in some cases? Strictly speaking, size_t doesn't have to encompass the entire addressable range, such as for architectures that use segmented addressing (e.g. near and far pointers). Practically speaking, no platform supported by ctypes makes this distinction, so c_size_t and c_ssize_t use the platform pointer size. https://hg.python.org/cpython/file/ab2c023a9432/Lib/ctypes/__init__.py#l459 OTOH, it's best to avoid accumulating layers of assumptions.
I missed c_size_t somehow, but as eryksun says, it's not strictly the same thing. Of course, my current patch isn't the same thing either as it only supports 32-bit and 64-bit pointer sizes. I could make a bigger change to use c_void_p and compare its .value against None instead of 0 (which seems to be the only difference)?