From 93bbe4e3ee034d22657e263a2fc6972589e6723f Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 4 Feb 2018 19:32:26 +0100 Subject: deps,src: align ssize_t ABI between Node & nghttp2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- deps/nghttp2/lib/includes/config.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'deps/nghttp2') 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 does not define. */ -#define ssize_t int +/* Edited to match src/node.h. */ +#include + +#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 // size_t, ssize_t +#endif // _WIN32 /* Define to 1 if you have the `std::map::emplace`. */ #define HAVE_STD_MAP_EMPLACE 1 -- cgit v1.2.1