Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
Diffstat (limited to 'deps')
-rw-r--r--deps/ngtcp2/lib/ngtcp2_cc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/deps/ngtcp2/lib/ngtcp2_cc.c b/deps/ngtcp2/lib/ngtcp2_cc.c
index 9c61a5e9564..3aed4dd759d 100644
--- a/deps/ngtcp2/lib/ngtcp2_cc.c
+++ b/deps/ngtcp2/lib/ngtcp2_cc.c
@@ -31,6 +31,19 @@
#include "ngtcp2_mem.h"
#include "ngtcp2_rcvry.h"
+#ifdef _MSC_VER
+#include <intrin.h>
+static inline int __builtin_clzll(unsigned long long x) {
+#if defined(_WIN64) || defined(_LP64)
+ return (int)__lzcnt64(x);
+#else
+ // TODO(@jasnell): Determine if there's an alternative available for x86
+ assert(0);
+#endif
+
+}
+#endif
+
uint64_t ngtcp2_cc_compute_initcwnd(size_t max_udp_payload_size) {
uint64_t n = 2 * max_udp_payload_size;
n = ngtcp2_max(n, 14720);