summaryrefslogtreecommitdiff
path: root/databases/mysql80-client/patches/patch-sql_join__optimizer_bit__utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'databases/mysql80-client/patches/patch-sql_join__optimizer_bit__utils.h')
-rw-r--r--databases/mysql80-client/patches/patch-sql_join__optimizer_bit__utils.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/databases/mysql80-client/patches/patch-sql_join__optimizer_bit__utils.h b/databases/mysql80-client/patches/patch-sql_join__optimizer_bit__utils.h
new file mode 100644
index 00000000000..80b5c8aefc8
--- /dev/null
+++ b/databases/mysql80-client/patches/patch-sql_join__optimizer_bit__utils.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-sql_join__optimizer_bit__utils.h,v 1.1 2021/06/27 06:41:55 nia Exp $
+
+NetBSD has no ffsll, but GCC does.
+
+--- sql/join_optimizer/bit_utils.h.orig 2021-03-22 08:44:50.000000000 +0000
++++ sql/join_optimizer/bit_utils.h
+@@ -82,6 +82,8 @@ static inline size_t FindLowestBitSet(ui
+ size_t idx;
+ asm("bsfq %1,%q0" : "=r"(idx) : "rm"(x));
+ return idx;
++#elif defined(__GNUC__) && !defined(HAVE_FFSLL)
++ return static_cast<unsigned>(__builtin_ffsll(x)) - 1u;
+ #else
+ // The cast to unsigned at least gets rid of the sign extension.
+ return static_cast<unsigned>(ffsll(x)) - 1u;