redmine

Fixed building with cluster and mhash

... ... @@ -20,7 +20,9 @@
#include <stdint.h>
#ifdef HAVE_MHASH
static inline adler32_calc(const unsigned char *const data, uint32_t len) {
#include <mhash.h>
static inline uint32_t adler32_calc(const unsigned char *const data, uint32_t len) {
uint32_t adler32;
MHASH td = mhash_init(MHASH_ADLER32);
... ...
... ... @@ -267,13 +267,7 @@ int clustercmd_adler32_calc(clustercmd_t *clustercmd_p, clustercmdadler32_t *clu
#endif
// Calculating
#ifdef HAVE_MHASH
MHASH td = mhash_init(MHASH_ADLER32);
mhash(td, ptr, size);
mhash_deinit(td, &adler32);
#else
adler32 = adler32_calc((unsigned char *)ptr, size);
#endif
// Ending
clustercmdadler32_p->dat = adler32 ^ 0xFFFFFFFF;
... ...