Skip to content

Commit

Permalink
src: fix ssize_t error from nghttp2.h
Browse files Browse the repository at this point in the history
The "node_http2.h" include reordering enforced by clang-format broke
Electron's Node.js upgrade on Windows. ssize_t is a part of the POSIX
standard and it's not available on Windows, so the fix for this is to
include "node.h" which typedefs it on Windows in
https://github.com/nodejs/node/blob/bb4dff783ddb3b20c67041f7ccef796c335c2407/src/node.h#L212-L220.

Refs: electron/electron#35350 (comment)
Signed-off-by: Darshan Sen <[email protected]>
PR-URL: #44393
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Shelley Vohr <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
RaisinTen authored and juanarbol committed Oct 10, 2022
1 parent 7b552fd commit 098be93
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/node_http2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

// FIXME(joyeecheung): nghttp2.h needs stdint.h to compile on Windows
#include <cstdint>
// clang-format off
#include "node.h" // nghttp2.h needs ssize_t
// clang-format on
#include "nghttp2/nghttp2.h"

#include "env.h"
Expand Down

0 comments on commit 098be93

Please sign in to comment.