Python Forum
Is there a problem with LONG_BIT in pyconfig.h ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there a problem with LONG_BIT in pyconfig.h ?
#4
The issue isn't just using the cygwin64 include files, it is also using the cygwin64 Python interpreter. If your original C++ library was compiled under cygwin64, then it thinks a C long has 64 bits. I think the cygwin64 compiled Python (and the related include files) also think a C long has 64 bits. So those should all work together.

But the standard Python for Windows thinks a C long has 32 bits and a C long long has 64 bits.

I use "long long" when I need to map a 64-bit integer Python on Windows. This is supported by Visual Studio and mingw64.

I don't know if Cython can resolve the issues of incompatible C compilers.

My recommendation would be to use VS or MSYS2/mingw64 and define your own types so you can use long on Linux and long long on Windows. That should work with either pybind11 or Cython.

casevh
Reply


Messages In This Thread
RE: Is there a problem with LONG_BIT in pyconfig.h ? - by casevh - Mar-06-2018, 03:20 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020