From f8feb0253d549e5872bad598b5b178fe9d0c3c4d Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 25 Aug 2018 01:36:16 +0200 Subject: [PATCH] src: add missing `NODE_WANT_INTERNALS` guards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/pull/22514 Reviewed-By: James M Snell --- src/aliased_buffer.h | 5 ++++- src/inspector_agent.h | 4 ++++ src/inspector_io.h | 4 ++++ src/inspector_socket.h | 3 +++ src/inspector_socket_server.h | 4 ++++ src/node_context_data.h | 4 ++++ src/node_contextify.h | 4 ++++ src/node_mutex.h | 4 ++++ src/node_perf_common.h | 4 ++++ src/node_platform.h | 4 ++++ 10 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/aliased_buffer.h b/src/aliased_buffer.h index 10659f6d529f02..931b2753646b8c 100644 --- a/src/aliased_buffer.h +++ b/src/aliased_buffer.h @@ -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" @@ -235,4 +236,6 @@ class AliasedBuffer { }; } // namespace node +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + #endif // SRC_ALIASED_BUFFER_H_ diff --git a/src/inspector_agent.h b/src/inspector_agent.h index 4e32d3ef1a96b4..d9e2232dcc4d7b 100644 --- a/src/inspector_agent.h +++ b/src/inspector_agent.h @@ -1,6 +1,8 @@ #ifndef SRC_INSPECTOR_AGENT_H_ #define SRC_INSPECTOR_AGENT_H_ +#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + #include #include @@ -120,4 +122,6 @@ class Agent { } // namespace inspector } // namespace node +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + #endif // SRC_INSPECTOR_AGENT_H_ diff --git a/src/inspector_io.h b/src/inspector_io.h index 2b9f0acd48383d..21df54e03126e9 100644 --- a/src/inspector_io.h +++ b/src/inspector_io.h @@ -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" @@ -90,4 +92,6 @@ class InspectorIo { } // namespace inspector } // namespace node +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + #endif // SRC_INSPECTOR_IO_H_ diff --git a/src/inspector_socket.h b/src/inspector_socket.h index ae49d78ff3452a..eca88ad45fe379 100644 --- a/src/inspector_socket.h +++ b/src/inspector_socket.h @@ -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" @@ -52,5 +54,6 @@ class InspectorSocket { } // namespace inspector } // namespace node +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #endif // SRC_INSPECTOR_SOCKET_H_ diff --git a/src/inspector_socket_server.h b/src/inspector_socket_server.h index 271be6ec555bf1..5c61b4e5ee3ddc 100644 --- a/src/inspector_socket_server.h +++ b/src/inspector_socket_server.h @@ -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" @@ -98,4 +100,6 @@ class InspectorSocketServer { } // namespace inspector } // namespace node +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + #endif // SRC_INSPECTOR_SOCKET_SERVER_H_ diff --git a/src/node_context_data.h b/src/node_context_data.h index 3892b31354027d..61ab81523cea59 100644 --- a/src/node_context_data.h +++ b/src/node_context_data.h @@ -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 @@ -37,4 +39,6 @@ enum ContextEmbedderIndex { } // namespace node +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + #endif // SRC_NODE_CONTEXT_DATA_H_ diff --git a/src/node_contextify.h b/src/node_contextify.h index d094692186167e..8af1d1d4fc3286 100644 --- a/src/node_contextify.h +++ b/src/node_contextify.h @@ -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" @@ -107,4 +109,6 @@ class ContextifyContext { } // namespace contextify } // namespace node +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + #endif // SRC_NODE_CONTEXTIFY_H_ diff --git a/src/node_mutex.h b/src/node_mutex.h index 9e1d31654f7dbf..de62a0d9ff66b7 100644 --- a/src/node_mutex.h +++ b/src/node_mutex.h @@ -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" @@ -184,4 +186,6 @@ MutexBase::ScopedUnlock::~ScopedUnlock() { } // namespace node +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + #endif // SRC_NODE_MUTEX_H_ diff --git a/src/node_perf_common.h b/src/node_perf_common.h index 8f90c93060dc4c..3c7e51361e6eae 100644 --- a/src/node_perf_common.h +++ b/src/node_perf_common.h @@ -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" @@ -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_ diff --git a/src/node_platform.h b/src/node_platform.h index 78b2883393b9fa..c2b5d6a5f9c704 100644 --- a/src/node_platform.h +++ b/src/node_platform.h @@ -1,6 +1,8 @@ #ifndef SRC_NODE_PLATFORM_H_ #define SRC_NODE_PLATFORM_H_ +#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + #include #include #include @@ -160,4 +162,6 @@ class NodePlatform : public MultiIsolatePlatform { } // namespace node +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + #endif // SRC_NODE_PLATFORM_H_