Skip to content

Commit b9bd4e9

Browse files
bghgaryrvagg
authored andcommitted
src: add include for standalone compile
- Include algorithm header in js_native_api_v8.cc since std::min requires it. - Add comments to js_native_api_v8_internals.h for NAPI_VERSION PR-URL: #24498 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent e37c618 commit b9bd4e9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/js_native_api_v8.cc

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <limits.h> // INT_MAX
22
#include <cmath>
3+
#include <algorithm>
34
#define NAPI_EXPERIMENTAL
45
#include "js_native_api_v8.h"
56
#include "js_native_api.h"

src/js_native_api_v8_internals.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
// The V8 implementation of N-API, including `js_native_api_v8.h` uses certain
55
// idioms which require definition here. For example, it uses a variant of
66
// persistent references which need not be reset in the constructor. It is the
7-
// responsibility of this file to define these idioms.
7+
// responsibility of this file to define these idioms. Optionally, this file
8+
// may also define `NAPI_VERSION` and set it to the version of N-API to be
9+
// exposed.
810

911
// In the case of the Node.js implementation of N-API some of the idioms are
1012
// imported directly from Node.js by including `node_internals.h` below. Others
11-
// are bridged to remove references to the `node` namespace.
13+
// are bridged to remove references to the `node` namespace. `node_version.h`,
14+
// included below, defines `NAPI_VERSION`.
1215

1316
#include "node_version.h"
1417
#include "env.h"

0 commit comments

Comments
 (0)