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:
authorJames M Snell <jasnell@gmail.com>2020-06-24 00:58:48 +0300
committerJames M Snell <jasnell@gmail.com>2020-06-24 22:33:15 +0300
commit9de95f494e25f3ba8100c54e6263736c2bfe48f0 (patch)
tree60ecb6c1c48a7c5c38c137518016f65240976343 /deps
parent86e67aaa699cfb028d381b6576234c3d30339801 (diff)
deps: temporary fixup for ngtcp2 to build on windows
The ngtcp2 update uses a gcc builtin that is not available under _MSC_VER. This floats a patch to fix it. Upstream PR: https://github.com/ngtcp2/ngtcp2/pull/247 PR-URL: https://github.com/nodejs/node/pull/34033 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
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);