summaryrefslogtreecommitdiff
path: root/extra/jemalloc/include/msvc_compat/strings.h
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-09-10 23:02:25 +0200
committerSergei Golubchik <sergii@pisem.net>2013-09-10 23:02:25 +0200
commit62643f81e6749913cdd250ec0db9529968addc50 (patch)
tree5deb1fbf586ee4cd46e02914cd65f1d23c7ac3f5 /extra/jemalloc/include/msvc_compat/strings.h
parent0e1070125f8fb2ffeba985345b001b3ca436bd44 (diff)
parent265bbf5fe172f1ccb68d2b9c1da93dc7ad1c6cee (diff)
downloadmariadb-git-62643f81e6749913cdd250ec0db9529968addc50.tar.gz
merge with 5.5-tokudb tree. In particular:
* add TokuDB, together with the ft-index library * cmake support, auto-detecting whether tokudb can be built * fix packaging - tokudb-engine.rpm, deb * remove PBXT * add jemalloc * the server is built with jemalloc by default even if TokuDB is not built * documentation files in RPM are installed in the correct location * support for optional deb packages (tokudb has specific build requirements) * move plugins from mariadb-server deb to appropriate debs (server/test/libmariadbclient) * correct mariadb-test.deb to be not architecture-independent * fix out-of-tree builds to never modify in-tree files * new handler::prepare_index_scan() method
Diffstat (limited to 'extra/jemalloc/include/msvc_compat/strings.h')
-rw-r--r--extra/jemalloc/include/msvc_compat/strings.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/extra/jemalloc/include/msvc_compat/strings.h b/extra/jemalloc/include/msvc_compat/strings.h
new file mode 100644
index 00000000000..c84975b6b8e
--- /dev/null
+++ b/extra/jemalloc/include/msvc_compat/strings.h
@@ -0,0 +1,23 @@
+#ifndef strings_h
+#define strings_h
+
+/* MSVC doesn't define ffs/ffsl. This dummy strings.h header is provided
+ * for both */
+#include <intrin.h>
+#pragma intrinsic(_BitScanForward)
+static __forceinline int ffsl(long x)
+{
+ unsigned long i;
+
+ if (_BitScanForward(&i, x))
+ return (i + 1);
+ return (0);
+}
+
+static __forceinline int ffs(int x)
+{
+
+ return (ffsl(x));
+}
+
+#endif