Mercurial > hg
changeset 44081:ef36156eac9f
sha1dc: manually define integer types on msvc 2008
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.
Differential Revision: https://phab.mercurial-scm.org/D7876
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 14 Jan 2020 17:37:04 -0800 |
parents | 4e05272dd681 |
children | c3f741bb2f33 |
files | mercurial/thirdparty/sha1dc/lib/sha1.h |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/thirdparty/sha1dc/lib/sha1.h Tue Jan 14 14:18:11 2020 -0800 +++ b/mercurial/thirdparty/sha1dc/lib/sha1.h Tue Jan 14 17:37:04 2020 -0800 @@ -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 <stdint.h> +#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 */