Skip to content

Commit eff96d3

Browse files
committed
src: add include guards to internal headers
For consistency with the newly added src/base64.h header, check that NODE_WANT_INTERNALS is defined and set in internal headers. PR-URL: #6948 Refs: #6910 Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trevor Norris <[email protected]>
1 parent 54785f5 commit eff96d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+204
-4
lines changed

node.gyp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@
706706
'GTEST_DONT_DEFINE_ASSERT_LE=1',
707707
'GTEST_DONT_DEFINE_ASSERT_LT=1',
708708
'GTEST_DONT_DEFINE_ASSERT_NE=1',
709+
'NODE_WANT_INTERNALS=1',
709710
],
710711
'sources': [
711712
'test/cctest/util.cc',

src/async-wrap-inl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_ASYNC_WRAP_INL_H_
22
#define SRC_ASYNC_WRAP_INL_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
#include "async-wrap.h"
57
#include "base-object.h"
68
#include "base-object-inl.h"
@@ -120,4 +122,6 @@ inline v8::Local<v8::Value> AsyncWrap::MakeCallback(
120122

121123
} // namespace node
122124

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

src/async-wrap.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_ASYNC_WRAP_H_
22
#define SRC_ASYNC_WRAP_H_
33

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

@@ -86,5 +88,6 @@ void LoadAsyncWrapperInfo(Environment* env);
8688

8789
} // namespace node
8890

91+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
8992

9093
#endif // SRC_ASYNC_WRAP_H_

src/base-object-inl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_BASE_OBJECT_INL_H_
22
#define SRC_BASE_OBJECT_INL_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
#include "base-object.h"
57
#include "env.h"
68
#include "env-inl.h"
@@ -68,4 +70,6 @@ inline void BaseObject::ClearWeak() {
6870

6971
} // namespace node
7072

73+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
74+
7175
#endif // SRC_BASE_OBJECT_INL_H_

src/base-object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_BASE_OBJECT_H_
22
#define SRC_BASE_OBJECT_H_
33

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

68
namespace node {
@@ -48,4 +50,6 @@ class BaseObject {
4850

4951
} // namespace node
5052

53+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
54+
5155
#endif // SRC_BASE_OBJECT_H_

src/debug-agent.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#ifndef SRC_DEBUG_AGENT_H_
2323
#define SRC_DEBUG_AGENT_H_
2424

25+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
26+
2527
#include "util.h"
2628
#include "util-inl.h"
2729
#include "uv.h"
@@ -132,4 +134,6 @@ class Agent {
132134
} // namespace debugger
133135
} // namespace node
134136

137+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
138+
135139
#endif // SRC_DEBUG_AGENT_H_

src/env-inl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_ENV_INL_H_
22
#define SRC_ENV_INL_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
#include "env.h"
57
#include "node.h"
68
#include "util.h"
@@ -576,4 +578,6 @@ inline v8::Local<v8::Object> Environment::NewInternalFieldObject() {
576578

577579
} // namespace node
578580

581+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
582+
579583
#endif // SRC_ENV_INL_H_

src/env.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_ENV_H_
22
#define SRC_ENV_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
#include "ares.h"
57
#include "debug-agent.h"
68
#include "handle_wrap.h"
@@ -647,4 +649,6 @@ class Environment {
647649

648650
} // namespace node
649651

652+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
653+
650654
#endif // SRC_ENV_H_

src/handle_wrap.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_HANDLE_WRAP_H_
22
#define SRC_HANDLE_WRAP_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
#include "async-wrap.h"
57
#include "util.h"
68
#include "uv.h"
@@ -69,5 +71,6 @@ class HandleWrap : public AsyncWrap {
6971

7072
} // namespace node
7173

74+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
7275

7376
#endif // SRC_HANDLE_WRAP_H_

src/js_stream.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef SRC_JS_STREAM_H_
22
#define SRC_JS_STREAM_H_
33

4+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5+
46
#include "async-wrap.h"
57
#include "env.h"
68
#include "stream_base.h"
@@ -48,4 +50,6 @@ class JSStream : public AsyncWrap, public StreamBase {
4850

4951
} // namespace node
5052

53+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
54+
5155
#endif // SRC_JS_STREAM_H_

0 commit comments

Comments
 (0)