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: https://github.com/nodejs/node/pull/22514
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Anna Henningsen 2018-08-25 01:36:16 +02:00
parent 66e6d7835e
commit 09fce8562a
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9
10 changed files with 39 additions and 1 deletions

View File

@ -1,7 +1,8 @@
#ifndef SRC_ALIASED_BUFFER_H_ #ifndef SRC_ALIASED_BUFFER_H_
#define SRC_ALIASED_BUFFER_H_ #define SRC_ALIASED_BUFFER_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include "v8.h" #include "v8.h"
#include "util-inl.h" #include "util-inl.h"
@ -235,4 +236,6 @@ class AliasedBuffer {
}; };
} // namespace node } // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_ALIASED_BUFFER_H_ #endif // SRC_ALIASED_BUFFER_H_

View File

@ -1,6 +1,8 @@
#ifndef SRC_INSPECTOR_AGENT_H_ #ifndef SRC_INSPECTOR_AGENT_H_
#define SRC_INSPECTOR_AGENT_H_ #define SRC_INSPECTOR_AGENT_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include <memory> #include <memory>
#include <stddef.h> #include <stddef.h>
@ -120,4 +122,6 @@ class Agent {
} // namespace inspector } // namespace inspector
} // namespace node } // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_INSPECTOR_AGENT_H_ #endif // SRC_INSPECTOR_AGENT_H_

View File

@ -1,6 +1,8 @@
#ifndef SRC_INSPECTOR_IO_H_ #ifndef SRC_INSPECTOR_IO_H_
#define SRC_INSPECTOR_IO_H_ #define SRC_INSPECTOR_IO_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include "inspector_socket_server.h" #include "inspector_socket_server.h"
#include "node_mutex.h" #include "node_mutex.h"
#include "uv.h" #include "uv.h"
@ -90,4 +92,6 @@ class InspectorIo {
} // namespace inspector } // namespace inspector
} // namespace node } // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_INSPECTOR_IO_H_ #endif // SRC_INSPECTOR_IO_H_

View File

@ -1,6 +1,8 @@
#ifndef SRC_INSPECTOR_SOCKET_H_ #ifndef SRC_INSPECTOR_SOCKET_H_
#define SRC_INSPECTOR_SOCKET_H_ #define SRC_INSPECTOR_SOCKET_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include "util-inl.h" #include "util-inl.h"
#include "uv.h" #include "uv.h"
@ -52,5 +54,6 @@ class InspectorSocket {
} // namespace inspector } // namespace inspector
} // namespace node } // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_INSPECTOR_SOCKET_H_ #endif // SRC_INSPECTOR_SOCKET_H_

View File

@ -1,6 +1,8 @@
#ifndef SRC_INSPECTOR_SOCKET_SERVER_H_ #ifndef SRC_INSPECTOR_SOCKET_SERVER_H_
#define 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_agent.h"
#include "inspector_socket.h" #include "inspector_socket.h"
#include "uv.h" #include "uv.h"
@ -98,4 +100,6 @@ class InspectorSocketServer {
} // namespace inspector } // namespace inspector
} // namespace node } // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_INSPECTOR_SOCKET_SERVER_H_ #endif // SRC_INSPECTOR_SOCKET_SERVER_H_

View File

@ -1,6 +1,8 @@
#ifndef SRC_NODE_CONTEXT_DATA_H_ #ifndef SRC_NODE_CONTEXT_DATA_H_
#define SRC_NODE_CONTEXT_DATA_H_ #define SRC_NODE_CONTEXT_DATA_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
namespace node { namespace node {
// Pick an index that's hopefully out of the way when we're embedded inside // Pick an index that's hopefully out of the way when we're embedded inside
@ -37,4 +39,6 @@ enum ContextEmbedderIndex {
} // namespace node } // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_NODE_CONTEXT_DATA_H_ #endif // SRC_NODE_CONTEXT_DATA_H_

View File

@ -1,6 +1,8 @@
#ifndef SRC_NODE_CONTEXTIFY_H_ #ifndef SRC_NODE_CONTEXTIFY_H_
#define SRC_NODE_CONTEXTIFY_H_ #define SRC_NODE_CONTEXTIFY_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include "node_internals.h" #include "node_internals.h"
#include "node_context_data.h" #include "node_context_data.h"
@ -107,4 +109,6 @@ class ContextifyContext {
} // namespace contextify } // namespace contextify
} // namespace node } // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_NODE_CONTEXTIFY_H_ #endif // SRC_NODE_CONTEXTIFY_H_

View File

@ -1,6 +1,8 @@
#ifndef SRC_NODE_MUTEX_H_ #ifndef SRC_NODE_MUTEX_H_
#define SRC_NODE_MUTEX_H_ #define SRC_NODE_MUTEX_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include "util.h" #include "util.h"
#include "uv.h" #include "uv.h"
@ -184,4 +186,6 @@ MutexBase<Traits>::ScopedUnlock::~ScopedUnlock() {
} // namespace node } // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_NODE_MUTEX_H_ #endif // SRC_NODE_MUTEX_H_

View File

@ -1,6 +1,8 @@
#ifndef SRC_NODE_PERF_COMMON_H_ #ifndef SRC_NODE_PERF_COMMON_H_
#define SRC_NODE_PERF_COMMON_H_ #define SRC_NODE_PERF_COMMON_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include "node.h" #include "node.h"
#include "v8.h" #include "v8.h"
@ -87,4 +89,6 @@ class performance_state {
} // namespace performance } // namespace performance
} // namespace node } // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_NODE_PERF_COMMON_H_ #endif // SRC_NODE_PERF_COMMON_H_

View File

@ -1,6 +1,8 @@
#ifndef SRC_NODE_PLATFORM_H_ #ifndef SRC_NODE_PLATFORM_H_
#define SRC_NODE_PLATFORM_H_ #define SRC_NODE_PLATFORM_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include <queue> #include <queue>
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
@ -158,4 +160,6 @@ class NodePlatform : public MultiIsolatePlatform {
} // namespace node } // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_NODE_PLATFORM_H_ #endif // SRC_NODE_PLATFORM_H_