We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 563a369 + 1dde678 commit 2289ecdCopy full SHA for 2289ecd
src/nvim/math.c
@@ -4,6 +4,10 @@
4
#include <stdint.h>
5
#include <string.h>
6
7
+#ifdef _MSC_VER
8
+# include <intrin.h> // Required for _BitScanForward64
9
+#endif
10
+
11
#include "nvim/math.h"
12
13
#ifdef INCLUDE_GENERATED_DECLARATIONS
@@ -52,6 +56,10 @@ int xctz(uint64_t x)
52
56
// Use compiler builtin if possible.
53
57
#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 4))
54
58
return __builtin_ctzll(x);
59
+#elif defined(_MSC_VER)
60
+ unsigned long index;
61
+ _BitScanForward64(&index, x);
62
+ return (int)index;
55
63
#else
64
int count = 0;
65
// Set x's trailing zeroes to ones and zero the rest.
0 commit comments