mercurial/util.h
changeset 24016 fb93721cc229
parent 24015 e2bf959a5a0d
child 24442 98042b0e19f9
--- 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_ */