Skip to content

Commit f8feb02

Browse files
addaleaxtargos
authored andcommitted
src: add missing NODE_WANT_INTERNALS guards
We generally add these to all headers that are considered internal to Node. These aren’t distributed as part of the headers tarball, so I think this does not have to be semver-major (and we have been changing the APIs in these headers freely anyway). PR-URL: #22514 Reviewed-By: James M Snell <[email protected]>
1 parent 5e7c651 commit f8feb02

10 files changed

+39
-1
lines changed

src/aliased_buffer.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
21
#ifndef SRC_ALIASED_BUFFER_H_
32
#define SRC_ALIASED_BUFFER_H_
43

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
56
#include "v8.h"
67
#include "util-inl.h"
78

@@ -235,4 +236,6 @@ class AliasedBuffer {
235236
};
236237
} // namespace node
237238

239+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
240+
238241
#endif // SRC_ALIASED_BUFFER_H_

src/inspector_agent.h

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_INSPECTOR_AGENT_H_
22
#define SRC_INSPECTOR_AGENT_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
#include <memory>
57

68
#include <stddef.h>
@@ -120,4 +122,6 @@ class Agent {
120122
} // namespace inspector
121123
} // namespace node
122124

125+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
126+
123127
#endif // SRC_INSPECTOR_AGENT_H_

src/inspector_io.h

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_INSPECTOR_IO_H_
22
#define SRC_INSPECTOR_IO_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
#include "inspector_socket_server.h"
57
#include "node_mutex.h"
68
#include "uv.h"
@@ -90,4 +92,6 @@ class InspectorIo {
9092
} // namespace inspector
9193
} // namespace node
9294

95+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
96+
9397
#endif // SRC_INSPECTOR_IO_H_

src/inspector_socket.h

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_INSPECTOR_SOCKET_H_
22
#define SRC_INSPECTOR_SOCKET_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
#include "util-inl.h"
57
#include "uv.h"
68

@@ -52,5 +54,6 @@ class InspectorSocket {
5254
} // namespace inspector
5355
} // namespace node
5456

57+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5558

5659
#endif // SRC_INSPECTOR_SOCKET_H_

src/inspector_socket_server.h

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_INSPECTOR_SOCKET_SERVER_H_
22
#define SRC_INSPECTOR_SOCKET_SERVER_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
#include "inspector_agent.h"
57
#include "inspector_socket.h"
68
#include "uv.h"
@@ -98,4 +100,6 @@ class InspectorSocketServer {
98100
} // namespace inspector
99101
} // namespace node
100102

103+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
104+
101105
#endif // SRC_INSPECTOR_SOCKET_SERVER_H_

src/node_context_data.h

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_NODE_CONTEXT_DATA_H_
22
#define SRC_NODE_CONTEXT_DATA_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
namespace node {
57

68
// Pick an index that's hopefully out of the way when we're embedded inside
@@ -37,4 +39,6 @@ enum ContextEmbedderIndex {
3739

3840
} // namespace node
3941

42+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
43+
4044
#endif // SRC_NODE_CONTEXT_DATA_H_

src/node_contextify.h

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_NODE_CONTEXTIFY_H_
22
#define SRC_NODE_CONTEXTIFY_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
#include "node_internals.h"
57
#include "node_context_data.h"
68

@@ -107,4 +109,6 @@ class ContextifyContext {
107109
} // namespace contextify
108110
} // namespace node
109111

112+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
113+
110114
#endif // SRC_NODE_CONTEXTIFY_H_

src/node_mutex.h

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_NODE_MUTEX_H_
22
#define SRC_NODE_MUTEX_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
#include "util.h"
57
#include "uv.h"
68

@@ -184,4 +186,6 @@ MutexBase<Traits>::ScopedUnlock::~ScopedUnlock() {
184186

185187
} // namespace node
186188

189+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
190+
187191
#endif // SRC_NODE_MUTEX_H_

src/node_perf_common.h

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_NODE_PERF_COMMON_H_
22
#define SRC_NODE_PERF_COMMON_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
#include "node.h"
57
#include "v8.h"
68

@@ -87,4 +89,6 @@ class performance_state {
8789
} // namespace performance
8890
} // namespace node
8991

92+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
93+
9094
#endif // SRC_NODE_PERF_COMMON_H_

src/node_platform.h

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_NODE_PLATFORM_H_
22
#define SRC_NODE_PLATFORM_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
#include <queue>
57
#include <unordered_map>
68
#include <vector>
@@ -160,4 +162,6 @@ class NodePlatform : public MultiIsolatePlatform {
160162

161163
} // namespace node
162164

165+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
166+
163167
#endif // SRC_NODE_PLATFORM_H_

0 commit comments

Comments
 (0)