summaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-02-04 19:32:26 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-02-10 14:39:54 +0100
commit93bbe4e3ee034d22657e263a2fc6972589e6723f (patch)
treee41b85e28d980127b0e2daa153f957df32cae55c /deps
parent180af17b522f531eb15b917f4fde9570b6aa95ae (diff)
downloadandroid-node-v8-93bbe4e3ee034d22657e263a2fc6972589e6723f.tar.gz
android-node-v8-93bbe4e3ee034d22657e263a2fc6972589e6723f.tar.bz2
android-node-v8-93bbe4e3ee034d22657e263a2fc6972589e6723f.zip
deps,src: align ssize_t ABI between Node & nghttp2
Previously, we performed casts that are considered undefined behavior. Instead, just define `ssize_t` for nghttp2 the same way we define it for the rest of Node. Also, remove a TODO comment that would probably also be *technically* correct but shouldn’t matter as long as nobody is complaining. PR-URL: https://github.com/nodejs/node/pull/18565 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps')
-rw-r--r--deps/nghttp2/lib/includes/config.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/deps/nghttp2/lib/includes/config.h b/deps/nghttp2/lib/includes/config.h
index 0346e0614f..242bbcfb62 100644
--- a/deps/nghttp2/lib/includes/config.h
+++ b/deps/nghttp2/lib/includes/config.h
@@ -1,8 +1,18 @@
/* Hint to the compiler that a function never returns */
#define NGHTTP2_NORETURN
-/* Define to `int' if <sys/types.h> does not define. */
-#define ssize_t int
+/* Edited to match src/node.h. */
+#include <stdint.h>
+
+#ifdef _WIN32
+#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
+typedef intptr_t ssize_t;
+# define _SSIZE_T_
+# define _SSIZE_T_DEFINED
+#endif
+#else // !_WIN32
+# include <sys/types.h> // size_t, ssize_t
+#endif // _WIN32
/* Define to 1 if you have the `std::map::emplace`. */
#define HAVE_STD_MAP_EMPLACE 1