Skip to content

Commit

Permalink
src: add missing NODE_WANT_INTERNALS guards
Browse files Browse the repository at this point in the history
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 <jasnell@gmail.com>
  • Loading branch information
addaleax authored and targos committed Sep 3, 2018
1 parent 5e7c651 commit f8feb02
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/aliased_buffer.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

#ifndef SRC_ALIASED_BUFFER_H_
#define SRC_ALIASED_BUFFER_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "v8.h"
#include "util-inl.h"

Expand Down Expand Up @@ -235,4 +236,6 @@ class AliasedBuffer {
};
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_ALIASED_BUFFER_H_
4 changes: 4 additions & 0 deletions src/inspector_agent.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_INSPECTOR_AGENT_H_
#define SRC_INSPECTOR_AGENT_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include <memory>

#include <stddef.h>
Expand Down Expand Up @@ -120,4 +122,6 @@ class Agent {
} // namespace inspector
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_INSPECTOR_AGENT_H_
4 changes: 4 additions & 0 deletions src/inspector_io.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_INSPECTOR_IO_H_
#define SRC_INSPECTOR_IO_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "inspector_socket_server.h"
#include "node_mutex.h"
#include "uv.h"
Expand Down Expand Up @@ -90,4 +92,6 @@ class InspectorIo {
} // namespace inspector
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_INSPECTOR_IO_H_
3 changes: 3 additions & 0 deletions src/inspector_socket.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_INSPECTOR_SOCKET_H_
#define SRC_INSPECTOR_SOCKET_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "util-inl.h"
#include "uv.h"

Expand Down Expand Up @@ -52,5 +54,6 @@ class InspectorSocket {
} // namespace inspector
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_INSPECTOR_SOCKET_H_
4 changes: 4 additions & 0 deletions src/inspector_socket_server.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_INSPECTOR_SOCKET_SERVER_H_
#define SRC_INSPECTOR_SOCKET_SERVER_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "inspector_agent.h"
#include "inspector_socket.h"
#include "uv.h"
Expand Down Expand Up @@ -98,4 +100,6 @@ class InspectorSocketServer {
} // namespace inspector
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_INSPECTOR_SOCKET_SERVER_H_
4 changes: 4 additions & 0 deletions src/node_context_data.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_NODE_CONTEXT_DATA_H_
#define SRC_NODE_CONTEXT_DATA_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

namespace node {

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

} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NODE_CONTEXT_DATA_H_
4 changes: 4 additions & 0 deletions src/node_contextify.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_NODE_CONTEXTIFY_H_
#define SRC_NODE_CONTEXTIFY_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "node_internals.h"
#include "node_context_data.h"

Expand Down Expand Up @@ -107,4 +109,6 @@ class ContextifyContext {
} // namespace contextify
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NODE_CONTEXTIFY_H_
4 changes: 4 additions & 0 deletions src/node_mutex.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_NODE_MUTEX_H_
#define SRC_NODE_MUTEX_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "util.h"
#include "uv.h"

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

} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NODE_MUTEX_H_
4 changes: 4 additions & 0 deletions src/node_perf_common.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_NODE_PERF_COMMON_H_
#define SRC_NODE_PERF_COMMON_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "node.h"
#include "v8.h"

Expand Down Expand Up @@ -87,4 +89,6 @@ class performance_state {
} // namespace performance
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NODE_PERF_COMMON_H_
4 changes: 4 additions & 0 deletions src/node_platform.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_NODE_PLATFORM_H_
#define SRC_NODE_PLATFORM_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include <queue>
#include <unordered_map>
#include <vector>
Expand Down Expand Up @@ -160,4 +162,6 @@ class NodePlatform : public MultiIsolatePlatform {

} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NODE_PLATFORM_H_

0 comments on commit f8feb02

Please sign in to comment.