D7903: sha1dc: avoid including the nonexistent stdint.h with Visual Studio 2008

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Wed Jan 15 23:35:00 EST 2020


mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7903

AFFECTED FILES
  mercurial/thirdparty/sha1dc/lib/ubc_check.c
  mercurial/thirdparty/sha1dc/lib/ubc_check.h

CHANGE DETAILS

diff --git a/mercurial/thirdparty/sha1dc/lib/ubc_check.h b/mercurial/thirdparty/sha1dc/lib/ubc_check.h
--- a/mercurial/thirdparty/sha1dc/lib/ubc_check.h
+++ b/mercurial/thirdparty/sha1dc/lib/ubc_check.h
@@ -28,7 +28,12 @@
 #endif
 
 #ifndef SHA1DC_NO_STANDARD_INCLUDES
+#if !defined(_MSC_VER) || _MSC_VER >= 1600
 #include <stdint.h>
+#else
+/* prior to Visual Studio 2010 */
+typedef unsigned int uint32_t;
+#endif
 #endif
 
 #define DVMASKSIZE 1
diff --git a/mercurial/thirdparty/sha1dc/lib/ubc_check.c b/mercurial/thirdparty/sha1dc/lib/ubc_check.c
--- a/mercurial/thirdparty/sha1dc/lib/ubc_check.c
+++ b/mercurial/thirdparty/sha1dc/lib/ubc_check.c
@@ -25,8 +25,10 @@
 */
 
 #ifndef SHA1DC_NO_STANDARD_INCLUDES
+#if !defined(_MSC_VER) || _MSC_VER >= 1600
 #include <stdint.h>
 #endif
+#endif
 #ifdef SHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C
 #include SHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C
 #endif



To: mharbison72, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list