Windows build fixes
Building 2.9.0 on MSVC7.1 was failing
This is because HAVE_CONFIG_H is not #defined
The patch addresses the above, adds testrecurse.exe and the
standard "make check" suite of tests to the MSVC makefile, and also
fixes the following (MSVC7.1) warnings:
buf.c(674) : warning C4028: formal parameter 1 different from
declaration
libxml2\timsort.h(71) : warning C4028: formal parameter 1 different from
declaration
diff --git a/timsort.h b/timsort.h
index 95f412b..b3a32f0 100644
--- a/timsort.h
+++ b/timsort.h
@@ -30,6 +30,14 @@
#endif
#endif
+#ifndef MK_UINT64
+#if defined(WIN32) && defined(_MSC_VER) && _MSC_VER < 1300
+#define MK_UINT64(x) ((uint64_t)(x))
+#else
+#define MK_UINT64(x) x##ULL
+#endif
+#endif
+
#ifndef MAX
#define MAX(x,y) (((x) > (y) ? (x) : (y)))
#endif
@@ -67,12 +75,12 @@
#endif
#endif
-int compute_minrun(const uint64_t size) /* {{{ */
+int compute_minrun(uint64_t size) /* {{{ */
{
const int top_bit = 64 - CLZ(size);
const int shift = MAX(top_bit, 6) - 6;
const int minrun = size >> shift;
- const uint64_t mask = (1ULL << shift) - 1;
+ const uint64_t mask = (MK_UINT64(1) << shift) - 1;
if (mask & size) return minrun + 1;
return minrun;
}