From d774ea5ccece3da399a05839adaa525d5ea6177e Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Fri, 17 May 2019 13:36:05 -0700 Subject: [PATCH] src: remove env-inl.h from header files Inline headers should only be included into the .cc files that use them. PR-URL: https://github.com/nodejs/node/pull/27755 Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- src/api/environment.cc | 2 +- src/api/utils.cc | 1 + src/debug_utils.cc | 1 + src/debug_utils.h | 2 +- src/inspector_agent.cc | 1 + src/js_native_api_v8.cc | 1 + src/node_api.cc | 2 +- src/node_constants.cc | 1 + src/node_credentials.cc | 1 + src/node_internals.h | 2 +- src/node_report.cc | 1 + src/node_report_utils.cc | 1 + src/node_url.h | 2 +- src/node_watchdog.cc | 4 +++- src/util.cc | 1 + test/cctest/node_test_fixture.h | 2 +- test/cctest/test_aliased_buffer.cc | 1 - test/cctest/test_url.cc | 1 + tools/js2c.py | 1 + tools/snapshot/node_mksnapshot.cc | 2 ++ 20 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/api/environment.cc b/src/api/environment.cc index 5dfac00647eddd..e5d06f27d13110 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -1,4 +1,4 @@ -#include "env.h" +#include "env-inl.h" #include "node.h" #include "node_context_data.h" #include "node_errors.h" diff --git a/src/api/utils.cc b/src/api/utils.cc index da7281a68f3bb1..3e59932f2f8b73 100644 --- a/src/api/utils.cc +++ b/src/api/utils.cc @@ -1,3 +1,4 @@ +#include "env-inl.h" #include "node.h" #include "node_internals.h" #include "util-inl.h" diff --git a/src/debug_utils.cc b/src/debug_utils.cc index b86710fba6e85b..a9bfa86b6d2aea 100644 --- a/src/debug_utils.cc +++ b/src/debug_utils.cc @@ -1,4 +1,5 @@ #include "debug_utils.h" +#include "env-inl.h" #include "util-inl.h" #ifdef __POSIX__ diff --git a/src/debug_utils.h b/src/debug_utils.h index ef5a4c0c47590c..db01cacba6a1b6 100644 --- a/src/debug_utils.h +++ b/src/debug_utils.h @@ -4,7 +4,7 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "async_wrap.h" -#include "env-inl.h" +#include "env.h" #include #include diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index d8b5d01a285834..c8e9af11f00443 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -1,5 +1,6 @@ #include "inspector_agent.h" +#include "env-inl.h" #include "inspector/main_thread_interface.h" #include "inspector/node_string.h" #include "inspector/runtime_agent.h" diff --git a/src/js_native_api_v8.cc b/src/js_native_api_v8.cc index 286086ab6af46d..da460e6b52b489 100644 --- a/src/js_native_api_v8.cc +++ b/src/js_native_api_v8.cc @@ -2,6 +2,7 @@ #include #include #define NAPI_EXPERIMENTAL +#include "env-inl.h" #include "js_native_api_v8.h" #include "js_native_api.h" #include "util-inl.h" diff --git a/src/node_api.cc b/src/node_api.cc index a6dc4615cab125..32393883d7c601 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -1,5 +1,5 @@ #include -#include "env.h" +#include "env-inl.h" #define NAPI_EXPERIMENTAL #include "js_native_api_v8.h" #include "node_api.h" diff --git a/src/node_constants.cc b/src/node_constants.cc index aa2afc59d95e64..7c9e4ce276112b 100644 --- a/src/node_constants.cc +++ b/src/node_constants.cc @@ -19,6 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +#include "env-inl.h" #include "node_constants.h" #include "node_internals.h" #include "util-inl.h" diff --git a/src/node_credentials.cc b/src/node_credentials.cc index d384504f2ac906..6f99cf6641eec3 100644 --- a/src/node_credentials.cc +++ b/src/node_credentials.cc @@ -1,3 +1,4 @@ +#include "env-inl.h" #include "node_internals.h" #include "util-inl.h" diff --git a/src/node_internals.h b/src/node_internals.h index 588941f127a754..8e6734192cbded 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -24,7 +24,7 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "env-inl.h" +#include "env.h" #include "node.h" #include "node_binding.h" #include "node_mutex.h" diff --git a/src/node_report.cc b/src/node_report.cc index 578da4376e07da..2f668b54630761 100644 --- a/src/node_report.cc +++ b/src/node_report.cc @@ -1,3 +1,4 @@ +#include "env-inl.h" #include "node_report.h" #include "debug_utils.h" #include "node_internals.h" diff --git a/src/node_report_utils.cc b/src/node_report_utils.cc index 33d7c52b34f78e..2581af06fac62d 100644 --- a/src/node_report_utils.cc +++ b/src/node_report_utils.cc @@ -1,3 +1,4 @@ +#include "env-inl.h" #include "node_internals.h" #include "node_report.h" #include "util-inl.h" diff --git a/src/node_url.h b/src/node_url.h index e85b14e2bdf35c..e85ca6e7129f6a 100644 --- a/src/node_url.h +++ b/src/node_url.h @@ -4,7 +4,7 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "node.h" -#include "env-inl.h" +#include "env.h" #include diff --git a/src/node_watchdog.cc b/src/node_watchdog.cc index 7c62aafa82257b..0c055489fcff68 100644 --- a/src/node_watchdog.cc +++ b/src/node_watchdog.cc @@ -19,11 +19,13 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "node_watchdog.h" #include + #include "debug_utils.h" +#include "env-inl.h" #include "node_errors.h" #include "node_internals.h" +#include "node_watchdog.h" #include "util-inl.h" namespace node { diff --git a/src/util.cc b/src/util.cc index 51f11b45396fa3..26dbfe844995eb 100644 --- a/src/util.cc +++ b/src/util.cc @@ -22,6 +22,7 @@ #include "util.h" // NOLINT(build/include_inline) #include "util-inl.h" +#include "env-inl.h" #include "node_buffer.h" #include "node_errors.h" #include "node_internals.h" diff --git a/test/cctest/node_test_fixture.h b/test/cctest/node_test_fixture.h index f5740e5ce9278a..a396f14d18c6e4 100644 --- a/test/cctest/node_test_fixture.h +++ b/test/cctest/node_test_fixture.h @@ -7,7 +7,7 @@ #include "node.h" #include "node_platform.h" #include "node_internals.h" -#include "env.h" +#include "env-inl.h" #include "util-inl.h" #include "v8.h" #include "libplatform/libplatform.h" diff --git a/test/cctest/test_aliased_buffer.cc b/test/cctest/test_aliased_buffer.cc index 5421dd6d14582e..ba947700c1bf27 100644 --- a/test/cctest/test_aliased_buffer.cc +++ b/test/cctest/test_aliased_buffer.cc @@ -1,4 +1,3 @@ - #include "v8.h" #include "aliased_buffer.h" #include "node_test_fixture.h" diff --git a/test/cctest/test_url.cc b/test/cctest/test_url.cc index ddef534b57485f..96f9741386360f 100644 --- a/test/cctest/test_url.cc +++ b/test/cctest/test_url.cc @@ -1,5 +1,6 @@ #include "node_url.h" #include "node_i18n.h" +#include "util-inl.h" #include "gtest/gtest.h" diff --git a/tools/js2c.py b/tools/js2c.py index 9c5130a91630c3..413158765551d3 100755 --- a/tools/js2c.py +++ b/tools/js2c.py @@ -177,6 +177,7 @@ def ReadMacros(macro_files): TEMPLATE = """ +#include "env-inl.h" #include "node_native_module.h" #include "node_internals.h" diff --git a/tools/snapshot/node_mksnapshot.cc b/tools/snapshot/node_mksnapshot.cc index c273ba20b610e1..5cf24f32b49e01 100644 --- a/tools/snapshot/node_mksnapshot.cc +++ b/tools/snapshot/node_mksnapshot.cc @@ -5,9 +5,11 @@ #include #include +#include "env-inl.h" #include "libplatform/libplatform.h" #include "node_internals.h" #include "snapshot_builder.h" +#include "util-inl.h" #include "v8.h" #ifdef _WIN32