summaryrefslogtreecommitdiff
path: root/textproc/randlm/files/patch-src-LDHT-Util.h
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2022-02-21 11:30:36 +0000
committerPiotr Kubaj <pkubaj@FreeBSD.org>2022-02-21 11:30:36 +0000
commit2988f607eda5bb18408318bb5a5e3a2d5917ea31 (patch)
tree95a89b04c68e847de501157132a4274d951e2deb /textproc/randlm/files/patch-src-LDHT-Util.h
parentdatabases/mariadb106-server: fix build on powerpc64le (diff)
textproc/randlm: fix build on powerpc*
rdtsc() is available only on amd64 / i386.
Diffstat (limited to 'textproc/randlm/files/patch-src-LDHT-Util.h')
-rw-r--r--textproc/randlm/files/patch-src-LDHT-Util.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/textproc/randlm/files/patch-src-LDHT-Util.h b/textproc/randlm/files/patch-src-LDHT-Util.h
index 4d03aae6710f..c3eb320265ef 100644
--- a/textproc/randlm/files/patch-src-LDHT-Util.h
+++ b/textproc/randlm/files/patch-src-LDHT-Util.h
@@ -1,5 +1,5 @@
---- src/LDHT/Util.h.orig 2012-03-30 14:53:05.000000000 +0400
-+++ src/LDHT/Util.h 2014-08-30 18:08:50.000000000 +0400
+--- src/LDHT/Util.h.orig 2012-03-30 10:53:05 UTC
++++ src/LDHT/Util.h
@@ -10,6 +10,10 @@
#include <cstdlib>
#include <cstring>
@@ -11,3 +11,21 @@
#define V(expr) std::cerr << __FILE__ << ":" \
<< __LINE__ << " " \
+@@ -43,6 +47,9 @@ class Util { (public)
+ static uint64_t hash(uint64_t a, uint64_t b, uint64_t P, uint8_t* e);
+ static uint64_t hash(uint64_t a, uint64_t b, uint64_t P, uint64_t e);
+ static inline uint64_t rdtsc() {
++#if defined(__powerpc__)
++ return __builtin_readcyclecounter();
++#else
+ uint32_t lo, hi;
+ __asm__ __volatile__(
+ "xorl %%eax,%%eax\n"
+@@ -52,6 +59,7 @@ class Util { (public)
+ :
+ : "%ebx", "%ecx");
+ return static_cast<uint64_t>(hi) << 32 | lo;
++#endif
+ };
+ };
+