You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In its current state, fasthash doesn't natively compile on MSVC, due to the syntax used in the mix macro:
h ^= mix(v);
The proposed solution would be to remove the brackets around the mix macro, then rewrite the references. Here is the complete code for the rewritten macro and fasthash64 function:
#definemix(h) { \
(h) ^= (h) >> 23; \
(h) *= 0x2127599bf4325c37ULL; \
(h) ^= (h) >> 47; }
uint64_tfasthash64(constvoid*buf, size_tlen, uint64_tseed)
{
constuint64_tm=0x880355f21e6d1965ULL;
constuint64_t*pos= (constuint64_t*)buf;
constuint64_t*end=pos+ (len / 8);
constunsigned char*pos2;
uint64_th=seed ^ (len*m);
uint64_tv;
while (pos!=end) {
v=*pos++;
mix(v);
h ^= v;
h *= m;
}
pos2= (constunsigned char*)pos;
v=0;
switch (len&7) {
case7: v ^= (uint64_t)pos2[6] << 48;
case6: v ^= (uint64_t)pos2[5] << 40;
case5: v ^= (uint64_t)pos2[4] << 32;
case4: v ^= (uint64_t)pos2[3] << 24;
case3: v ^= (uint64_t)pos2[2] << 16;
case2: v ^= (uint64_t)pos2[1] << 8;
case1: v ^= (uint64_t)pos2[0];
mix(v);
h ^= v;
h *= m;
}
mix(h);
returnh;
}
The text was updated successfully, but these errors were encountered:
In its current state, fasthash doesn't natively compile on MSVC, due to the syntax used in the mix macro:
The proposed solution would be to remove the brackets around the mix macro, then rewrite the references. Here is the complete code for the rewritten macro and fasthash64 function:
The text was updated successfully, but these errors were encountered: