diff -r e2bf959a5a0d -r fb93721cc229 mercurial/util.h --- a/mercurial/util.h Tue Jan 20 14:09:57 2015 -0500 +++ b/mercurial/util.h Tue Feb 03 13:17:21 2015 -0500 @@ -196,4 +196,17 @@ c[3] = (x) & 0xff; } +static inline double getbefloat64(const char *c) +{ + const unsigned char *d = (const unsigned char *)c; + double ret; + int i; + uint64_t t = 0; + for (i = 0; i < 8; i++) { + t = (t<<8) + d[i]; + } + memcpy(&ret, &t, sizeof(t)); + return ret; +} + #endif /* _HG_UTIL_H_ */