0

It seems that on macOS Python's c_ulong type is 64 bits, instead of the 32 bits that it would be on Windows. From what I've found in my google search, based on this post: Is Python's ctypes.c_long 64 bit on 64 bit systems?

It looks like it's because of macOS's memory model. Is there any fix for this?

1 Answers1

0

Just like if you are writing C, if you know that you specifically need a 32 bit unsigned integer, you shouldn't use c_ulong but instead ctypes.c_uint32. This way you can ensure it will be 32 bits no matter the platform you are on.

SethMMorton
  • 45,752
  • 12
  • 65
  • 86