This is an archive of the discontinued Mercurial Phabricator instance.

cext: restore the ability to build on Windows with py2
ClosedPublic

Authored by mharbison72 on Jan 25 2021, 7:26 PM.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mharbison72 created this revision.Jan 25 2021, 7:26 PM
pulkit accepted this revision.Jan 26 2021, 2:59 PM
This revision is now accepted and ready to land.Jan 26 2021, 2:59 PM

I installed Visual C++ 2008 for Python 2.7 and I confirm that this version doesn't support the "inline" keyword.

Can you please try the following pull request? https://github.com/pythoncapi/pythoncapi_compat/pull/3 If it works, I merge it in pythoncapi_compat and then you can copy the updated file into Mercurial and python-zstandard.

I installed Visual C++ 2008 for Python 2.7 and I confirm that this version doesn't support the "inline" keyword.
Can you please try the following pull request? https://github.com/pythoncapi/pythoncapi_compat/pull/3 If it works, I merge it in pythoncapi_compat and then you can copy the updated file into Mercurial and python-zstandard.

I pasted that file into Mercurial, reverted the other changes that don't appear in this diff, and it does compile on py2 and py3 now.

I pasted that file into Mercurial, reverted the other changes that don't appear in this diff, and it does compile on py2 and py3 now.

Nice! I merged my PR. I suggest you to simply copy the updated file from:

For now I suggest to embed a copy of this header file in your project. You should not need to update it unless you need new functions (which will be added later).

Oh, cool! I see that someone updated mercurial/pythoncapi_compat.h and contrib/python-zstandard/zstd/common/pythoncapi_compat.h to retrieve my VS 2008 fix!

I created https://github.com/indygreg/python-zstandard/pull/135 to update python-zstandard upstream ;-)