mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
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
This commit is contained in:
committed by
Daniel Veillard
parent
3f6cfbd1d3
commit
bbe194518f
12
timsort.h
12
timsort.h
@@ -30,6 +30,14 @@ typedef unsigned __int64 uint64_t;
|
||||
#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 @@ int clzll(uint64_t x) /* {{{ */
|
||||
#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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user