From patchwork Wed Jan 15 01:54:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D7876: sha1dc: manually define integer types on msvc 2008 From: phabricator X-Patchwork-Id: 44349 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 15 Jan 2020 01:54:46 +0000 indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Python 2.7 on Windows builds with MSVC 2008, which doesn't include stdint.h. So we need to check for the compiler version and manually define missing types when it is ancient. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D7876 AFFECTED FILES mercurial/thirdparty/sha1dc/lib/sha1.h CHANGE DETAILS To: indygreg, #hg-reviewers Cc: mercurial-devel diff --git a/mercurial/thirdparty/sha1dc/lib/sha1.h b/mercurial/thirdparty/sha1dc/lib/sha1.h --- a/mercurial/thirdparty/sha1dc/lib/sha1.h +++ b/mercurial/thirdparty/sha1dc/lib/sha1.h @@ -13,7 +13,14 @@ #endif #ifndef SHA1DC_NO_STANDARD_INCLUDES +/* PY27 this can be changed to a straight #include once Python 2.7 is + dropped, since this is for MSVC 2008 support. */ +#if !defined(_MSC_VER) || _MSC_VER >= 1600 #include +#else +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; +#endif #endif /* sha-1 compression function that takes an already expanded message, and additionally store intermediate states */