[PATCH][win32] problems compiling bzrlib/_dirstate_helpers_c.pyx with MSVC
Alexander Belchenko
bialix at ukr.net
Tue Jul 31 05:06:36 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John,
I have troubles to compiling bzrlib/_dirstate_helpers_c.pyx on Windows with MSVC2003.
Actually generated C-file is incompatible with MSVC in 2 cases:
1) you're using #include <stdint.h>, but MSVC is not C99 compiler, and don't have such
header.
Actually you need only `typedef int intptr_t` from this header,
but Pyrex is smart enough to substitute intptr_t with int in
generated C-code, so actually stdint.h is not used at all.
2) in function _py_memrchr you're calculate difference between 2 void* pointers,
but MSVC don't allow arithmetic operations for void* pointers.
Actually these pointers are pointers to strings, i.e. char*,
but for some reason you're using void*. Explicit cast to char*
solve this problem.
After I make 2 little changes (diff attached) I can successfully compile pyx
and run the tests. All tests related to dirstate_helpers are passed.
Please, take a look on my patch.
- --
[µ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGrrVMzYr338mxwCURAl/oAJ41Tc3TbV+oQejx6BaTmnhHp7wZFwCdGv2F
GyyihaAlYtrhy1vfeQ2sjh0=
=hFIT
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: _dirstate_helpers_c.diff
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20070731/686f2429/attachment.diff
More information about the bazaar
mailing list