Skip to content

src: fix `ssize_t` error from `nghttp2.h`

The "node_http2.h" include reordering enforced by clang-format (https://github.com/nodejs/node/commit/32446d8c8aaf293321cd712a7d63ea8f2b5fd712#diff-33f026e43570112875cf4c8eab6743496f3aa014329611128e348ec23d6f771cR1) broke Electron's Node.js upgrade on Windows.

https://ci.appveyor.com/project/electron-bot/electron-x64-testing/builds/44562886/job/vf7dodmpnfn47y68

In file included from ../../third_party/electron_node/src/node_http2.cc:1:
In file included from ../../third_party/electron_node/src/node_http2.h:8:
../../third_party/electron_node/deps/nghttp2/lib/includes\nghttp2/nghttp2.h(930,9): error: unknown type name 'ssize_t'
typedef ssize_t (*nghttp2_data_source_read_callback)(
        ^

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: https://github.com/electron/electron/pull/35350#discussion_r954890551 Signed-off-by: Darshan Sen raisinten@gmail.com

cc @nodejs/cpp-reviewers

Merge request reports

Loading