From f6a52a2395574827114884ab5cd46df9f0281758 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 30 Oct 2017 17:46:58 +0800 Subject: [PATCH 1/3] src: do not include x.h if x-inl.h is included Fixes: https://github.com/nodejs/node/issues/16519 PR-URL: https://github.com/nodejs/node/pull/16548 Reviewed-By: Ben Noordhuis Reviewed-By: Gireesh Punathil Reviewed-By: Daniel Bevenius Reviewed-By: Gibson Fahnestock Reviewed-By: Colin Ihrig --- src/aliased_buffer.h | 1 - src/async-wrap-inl.h | 1 - src/async-wrap.cc | 2 -- src/base-object-inl.h | 2 -- src/cares_wrap.cc | 2 -- src/connect_wrap.cc | 2 -- src/connection_wrap.cc | 2 -- src/env-inl.h | 1 - src/fs_event_wrap.cc | 2 -- src/handle_wrap.cc | 2 -- src/inspector_io.cc | 1 - src/inspector_js_api.cc | 1 - src/inspector_socket.cc | 1 - src/inspector_socket.h | 1 - src/js_stream.cc | 2 -- src/module_wrap.cc | 1 - src/module_wrap.h | 1 - src/node.cc | 2 -- src/node_buffer.cc | 2 -- src/node_config.cc | 2 -- src/node_contextify.cc | 1 - src/node_counters.cc | 1 - src/node_crypto.cc | 2 -- src/node_crypto.h | 4 +--- src/node_crypto_bio.cc | 1 - src/node_crypto_bio.h | 2 -- src/node_crypto_clienthello-inl.h | 1 - src/node_crypto_clienthello.cc | 1 - src/node_dtrace.cc | 1 - src/node_file.cc | 1 - src/node_http2_core.h | 1 - src/node_http_parser.cc | 2 -- src/node_i18n.cc | 3 --- src/node_internals.h | 2 -- src/node_lttng.cc | 1 - src/node_perf.h | 1 - src/node_serdes.cc | 1 - src/node_stat_watcher.cc | 2 -- src/node_url.cc | 1 - src/node_url.h | 1 - src/node_v8.cc | 2 -- src/node_win32_etw_provider.cc | 1 - src/node_zlib.cc | 2 -- src/pipe_wrap.cc | 3 --- src/process_wrap.cc | 2 -- src/req-wrap-inl.h | 2 -- src/signal_wrap.cc | 2 -- src/stream_base-inl.h | 1 - src/stream_base.cc | 3 --- src/stream_base.h | 1 - src/stream_wrap.cc | 3 --- src/string_bytes.h | 1 - src/tcp_wrap.cc | 2 -- src/timer_wrap.cc | 2 -- src/tls_wrap.cc | 4 +--- src/tty_wrap.cc | 3 --- src/udp_wrap.cc | 2 -- src/udp_wrap.h | 1 - src/uv.cc | 1 - 59 files changed, 2 insertions(+), 97 deletions(-) diff --git a/src/aliased_buffer.h b/src/aliased_buffer.h index 2e5598b4757902..21aaeb61141c59 100644 --- a/src/aliased_buffer.h +++ b/src/aliased_buffer.h @@ -3,7 +3,6 @@ #define SRC_ALIASED_BUFFER_H_ #include "v8.h" -#include "util.h" #include "util-inl.h" namespace node { diff --git a/src/async-wrap-inl.h b/src/async-wrap-inl.h index dd947dbd446cac..617d51dc59f037 100644 --- a/src/async-wrap-inl.h +++ b/src/async-wrap-inl.h @@ -25,7 +25,6 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "async-wrap.h" -#include "base-object.h" #include "base-object-inl.h" #include "node_internals.h" diff --git a/src/async-wrap.cc b/src/async-wrap.cc index 3980293453b4eb..1b1452b69379c7 100644 --- a/src/async-wrap.cc +++ b/src/async-wrap.cc @@ -19,11 +19,9 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" #include "env-inl.h" -#include "util.h" #include "util-inl.h" #include "uv.h" diff --git a/src/base-object-inl.h b/src/base-object-inl.h index 94449819a83239..480edd7463e7f0 100644 --- a/src/base-object-inl.h +++ b/src/base-object-inl.h @@ -25,9 +25,7 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "base-object.h" -#include "env.h" #include "env-inl.h" -#include "util.h" #include "util-inl.h" #include "v8.h" diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index e800e0f2fee260..7b8ec12d051e0c 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -21,12 +21,10 @@ #define CARES_STATICLIB #include "ares.h" -#include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" #include "env-inl.h" #include "node.h" -#include "req-wrap.h" #include "req-wrap-inl.h" #include "util.h" #include "util-inl.h" diff --git a/src/connect_wrap.cc b/src/connect_wrap.cc index e373b5a36e33e6..6a2857ba7e30df 100644 --- a/src/connect_wrap.cc +++ b/src/connect_wrap.cc @@ -1,8 +1,6 @@ #include "connect_wrap.h" -#include "env.h" #include "env-inl.h" -#include "req-wrap.h" #include "req-wrap-inl.h" #include "util.h" #include "util-inl.h" diff --git a/src/connection_wrap.cc b/src/connection_wrap.cc index a7f08ecc19f2d8..b620c387ff1cfc 100644 --- a/src/connection_wrap.cc +++ b/src/connection_wrap.cc @@ -2,11 +2,9 @@ #include "connect_wrap.h" #include "env-inl.h" -#include "env.h" #include "pipe_wrap.h" #include "stream_wrap.h" #include "tcp_wrap.h" -#include "util.h" #include "util-inl.h" namespace node { diff --git a/src/env-inl.h b/src/env-inl.h index e6e189be3dcbab..2cd0046b85475e 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -27,7 +27,6 @@ #include "aliased_buffer.h" #include "env.h" #include "node.h" -#include "util.h" #include "util-inl.h" #include "uv.h" #include "v8.h" diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index 8ec8dd6dcfbd76..5a8693c380b822 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -19,11 +19,9 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" #include "env-inl.h" -#include "util.h" #include "util-inl.h" #include "node.h" #include "handle_wrap.h" diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc index 7d0925e2fd6354..bc4c222deaf5d0 100644 --- a/src/handle_wrap.cc +++ b/src/handle_wrap.cc @@ -20,11 +20,9 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. #include "handle_wrap.h" -#include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" #include "env-inl.h" -#include "util.h" #include "util-inl.h" #include "node.h" diff --git a/src/inspector_io.cc b/src/inspector_io.cc index 12a0d20720354a..73f0419ead6545 100644 --- a/src/inspector_io.cc +++ b/src/inspector_io.cc @@ -1,7 +1,6 @@ #include "inspector_io.h" #include "inspector_socket_server.h" -#include "env.h" #include "env-inl.h" #include "node.h" #include "node_crypto.h" diff --git a/src/inspector_js_api.cc b/src/inspector_js_api.cc index 8bd682351a0531..f72517bac18c70 100644 --- a/src/inspector_js_api.cc +++ b/src/inspector_js_api.cc @@ -1,4 +1,3 @@ -#include "base-object.h" #include "base-object-inl.h" #include "inspector_agent.h" #include "inspector_io.h" diff --git a/src/inspector_socket.cc b/src/inspector_socket.cc index 092138a7fa6f90..265b37616138dc 100644 --- a/src/inspector_socket.cc +++ b/src/inspector_socket.cc @@ -1,5 +1,4 @@ #include "inspector_socket.h" -#include "util.h" #include "util-inl.h" #define NODE_WANT_INTERNALS 1 diff --git a/src/inspector_socket.h b/src/inspector_socket.h index ee4bd7835c75ff..f93150d6f9a1cf 100644 --- a/src/inspector_socket.h +++ b/src/inspector_socket.h @@ -2,7 +2,6 @@ #define SRC_INSPECTOR_SOCKET_H_ #include "http_parser.h" -#include "util.h" #include "util-inl.h" #include "uv.h" diff --git a/src/js_stream.cc b/src/js_stream.cc index a279970c1bbfca..9d28b90585048a 100644 --- a/src/js_stream.cc +++ b/src/js_stream.cc @@ -1,10 +1,8 @@ #include "js_stream.h" #include "async-wrap.h" -#include "env.h" #include "env-inl.h" #include "node_buffer.h" -#include "stream_base.h" #include "stream_base-inl.h" #include "v8.h" diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 92dc9cf917934f..c28fe6580e0802 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -5,7 +5,6 @@ #include "env.h" #include "node_url.h" -#include "util.h" #include "util-inl.h" #include "node_internals.h" diff --git a/src/module_wrap.h b/src/module_wrap.h index ac2f90476d5b59..e0f7ce5bd2dddc 100644 --- a/src/module_wrap.h +++ b/src/module_wrap.h @@ -7,7 +7,6 @@ #include #include #include "node_url.h" -#include "base-object.h" #include "base-object-inl.h" namespace node { diff --git a/src/node.cc b/src/node.cc index 7a7db9140f88a4..e91760903c0147 100644 --- a/src/node.cc +++ b/src/node.cc @@ -54,14 +54,12 @@ #endif #include "ares.h" -#include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" #include "env-inl.h" #include "handle_wrap.h" #include "http_parser.h" #include "nghttp2/nghttp2ver.h" -#include "req-wrap.h" #include "req-wrap-inl.h" #include "string_bytes.h" #include "tracing/agent.h" diff --git a/src/node_buffer.cc b/src/node_buffer.cc index d6e4aa9da072db..b39bbbb5d28265 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -22,11 +22,9 @@ #include "node.h" #include "node_buffer.h" -#include "env.h" #include "env-inl.h" #include "string_bytes.h" #include "string_search.h" -#include "util.h" #include "util-inl.h" #include "v8-profiler.h" #include "v8.h" diff --git a/src/node_config.cc b/src/node_config.cc index a11faaefec37d4..7fa275b8df05cc 100644 --- a/src/node_config.cc +++ b/src/node_config.cc @@ -1,8 +1,6 @@ #include "node.h" #include "node_i18n.h" -#include "env.h" #include "env-inl.h" -#include "util.h" #include "util-inl.h" #include "node_debug_options.h" diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 988de8bb506438..1a44b5e4410294 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -21,7 +21,6 @@ #include "node_internals.h" #include "node_watchdog.h" -#include "base-object.h" #include "base-object-inl.h" #include "v8-debug.h" diff --git a/src/node_counters.cc b/src/node_counters.cc index c6e9ea50379cb0..06d2b9f68f103e 100644 --- a/src/node_counters.cc +++ b/src/node_counters.cc @@ -21,7 +21,6 @@ #include "node_counters.h" #include "uv.h" -#include "env.h" #include "env-inl.h" #include diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 1c953f093146c7..a576e5e10fec56 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -28,12 +28,10 @@ #include "node_mutex.h" #include "tls_wrap.h" // TLSWrap -#include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" #include "env-inl.h" #include "string_bytes.h" -#include "util.h" #include "util-inl.h" #include "v8.h" // CNNIC Hash WhiteList is taken from diff --git a/src/node_crypto.h b/src/node_crypto.h index 3abfe973a79ebd..a155411aa8195c 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -25,15 +25,13 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "node.h" -#include "node_crypto_clienthello.h" // ClientHelloParser +// ClientHelloParser #include "node_crypto_clienthello-inl.h" #include "node_buffer.h" #include "env.h" -#include "async-wrap.h" #include "async-wrap-inl.h" -#include "base-object.h" #include "base-object-inl.h" #include "v8.h" diff --git a/src/node_crypto_bio.cc b/src/node_crypto_bio.cc index 00fd0b420c38c5..eb1399f0bffb96 100644 --- a/src/node_crypto_bio.cc +++ b/src/node_crypto_bio.cc @@ -21,7 +21,6 @@ #include "node_crypto_bio.h" #include "openssl/bio.h" -#include "util.h" #include "util-inl.h" #include #include diff --git a/src/node_crypto_bio.h b/src/node_crypto_bio.h index 5deac922323808..6ec256d008153b 100644 --- a/src/node_crypto_bio.h +++ b/src/node_crypto_bio.h @@ -25,9 +25,7 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "openssl/bio.h" -#include "env.h" #include "env-inl.h" -#include "util.h" #include "util-inl.h" #include "v8.h" diff --git a/src/node_crypto_clienthello-inl.h b/src/node_crypto_clienthello-inl.h index 84cce301547561..019d7188de6cf3 100644 --- a/src/node_crypto_clienthello-inl.h +++ b/src/node_crypto_clienthello-inl.h @@ -25,7 +25,6 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "node_crypto_clienthello.h" -#include "util.h" #include "util-inl.h" namespace node { diff --git a/src/node_crypto_clienthello.cc b/src/node_crypto_clienthello.cc index 65b5dff7f74447..d4d222f838c5ac 100644 --- a/src/node_crypto_clienthello.cc +++ b/src/node_crypto_clienthello.cc @@ -19,7 +19,6 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "node_crypto_clienthello.h" #include "node_crypto_clienthello-inl.h" namespace node { diff --git a/src/node_dtrace.cc b/src/node_dtrace.cc index 39014e710577d4..ed063fddfafc49 100644 --- a/src/node_dtrace.cc +++ b/src/node_dtrace.cc @@ -24,7 +24,6 @@ #ifdef HAVE_DTRACE #include "node_provider.h" #elif HAVE_ETW -#include "node_win32_etw_provider.h" #include "node_win32_etw_provider-inl.h" #else #define NODE_HTTP_SERVER_REQUEST(arg0, arg1) diff --git a/src/node_file.cc b/src/node_file.cc index 887dff5a030e06..5039f3ff1e71ff 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -23,7 +23,6 @@ #include "node_internals.h" #include "node_stat_watcher.h" -#include "req-wrap.h" #include "req-wrap-inl.h" #include "string_bytes.h" diff --git a/src/node_http2_core.h b/src/node_http2_core.h index 21df45c42ce8ba..2e885b73dab8f5 100644 --- a/src/node_http2_core.h +++ b/src/node_http2_core.h @@ -3,7 +3,6 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "util.h" #include "util-inl.h" #include "uv.h" #include "nghttp2/nghttp2.h" diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index 11d0aa42b23829..329da616f7cf1a 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -22,12 +22,10 @@ #include "node.h" #include "node_buffer.h" -#include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" #include "env-inl.h" #include "http_parser.h" -#include "stream_base.h" #include "stream_base-inl.h" #include "util.h" #include "util-inl.h" diff --git a/src/node_i18n.cc b/src/node_i18n.cc index 2e1aeaa4cb07c5..30f421a8b8384b 100644 --- a/src/node_i18n.cc +++ b/src/node_i18n.cc @@ -46,11 +46,8 @@ #include "node.h" #include "node_buffer.h" -#include "env.h" #include "env-inl.h" -#include "util.h" #include "util-inl.h" -#include "base-object.h" #include "base-object-inl.h" #include "v8.h" diff --git a/src/node_internals.h b/src/node_internals.h index e2e81d61e31bd4..85f90a60f8d278 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -25,9 +25,7 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "node.h" -#include "util.h" #include "util-inl.h" -#include "env.h" #include "env-inl.h" #include "uv.h" #include "v8.h" diff --git a/src/node_lttng.cc b/src/node_lttng.cc index 490beb6e40007d..1f6f4322a5fe79 100644 --- a/src/node_lttng.cc +++ b/src/node_lttng.cc @@ -21,7 +21,6 @@ #define NODE_GC_DONE(arg0, arg1, arg2) #endif -#include "env.h" #include "env-inl.h" namespace node { diff --git a/src/node_perf.h b/src/node_perf.h index 6699272e883367..ba7a326471d695 100644 --- a/src/node_perf.h +++ b/src/node_perf.h @@ -6,7 +6,6 @@ #include "node.h" #include "node_perf_common.h" #include "env.h" -#include "base-object.h" #include "base-object-inl.h" #include "v8.h" diff --git a/src/node_serdes.cc b/src/node_serdes.cc index f477016ec03e9f..4e99513a5fd31c 100644 --- a/src/node_serdes.cc +++ b/src/node_serdes.cc @@ -1,6 +1,5 @@ #include "node_internals.h" #include "node_buffer.h" -#include "base-object.h" #include "base-object-inl.h" namespace node { diff --git a/src/node_stat_watcher.cc b/src/node_stat_watcher.cc index 4b2e4db7bc418c..46414bcbfd7a2c 100644 --- a/src/node_stat_watcher.cc +++ b/src/node_stat_watcher.cc @@ -20,11 +20,9 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. #include "node_stat_watcher.h" -#include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" #include "env-inl.h" -#include "util.h" #include "util-inl.h" #include diff --git a/src/node_url.cc b/src/node_url.cc index e7a0b47194e84a..49c005a23bc2c7 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -1,6 +1,5 @@ #include "node_url.h" #include "node_internals.h" -#include "base-object.h" #include "base-object-inl.h" #include "node_i18n.h" diff --git a/src/node_url.h b/src/node_url.h index 503fb21e0d4f30..872f2fbc97f65c 100644 --- a/src/node_url.h +++ b/src/node_url.h @@ -4,7 +4,6 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "node.h" -#include "env.h" #include "env-inl.h" #include diff --git a/src/node_v8.cc b/src/node_v8.cc index f46bed248ea2d9..8b4d31a880dc0c 100644 --- a/src/node_v8.cc +++ b/src/node_v8.cc @@ -20,9 +20,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. #include "node.h" -#include "env.h" #include "env-inl.h" -#include "util.h" #include "util-inl.h" #include "v8.h" diff --git a/src/node_win32_etw_provider.cc b/src/node_win32_etw_provider.cc index 8a854767d6aed8..11694d7d0e43ea 100644 --- a/src/node_win32_etw_provider.cc +++ b/src/node_win32_etw_provider.cc @@ -19,7 +19,6 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "node_win32_etw_provider.h" #include "node_etw_provider.h" #include "node_win32_etw_provider-inl.h" diff --git a/src/node_zlib.cc b/src/node_zlib.cc index e48482cdc752f3..2133aac26ce2ae 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -22,11 +22,9 @@ #include "node.h" #include "node_buffer.h" -#include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" #include "env-inl.h" -#include "util.h" #include "util-inl.h" #include "v8.h" diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index 72dd99c1e5cc97..b76b31e81df45b 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -23,7 +23,6 @@ #include "async-wrap.h" #include "connection_wrap.h" -#include "env.h" #include "env-inl.h" #include "handle_wrap.h" #include "node.h" @@ -32,8 +31,6 @@ #include "connect_wrap.h" #include "stream_wrap.h" #include "util-inl.h" -#include "util.h" - namespace node { using v8::Context; diff --git a/src/process_wrap.cc b/src/process_wrap.cc index d5a408af692111..c1148f9bfb26ff 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -19,11 +19,9 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "env.h" #include "env-inl.h" #include "handle_wrap.h" #include "node_wrap.h" -#include "util.h" #include "util-inl.h" #include diff --git a/src/req-wrap-inl.h b/src/req-wrap-inl.h index e21fb1bdad9363..045cb298e46344 100644 --- a/src/req-wrap-inl.h +++ b/src/req-wrap-inl.h @@ -4,11 +4,9 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "req-wrap.h" -#include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" #include "env-inl.h" -#include "util.h" #include "util-inl.h" namespace node { diff --git a/src/signal_wrap.cc b/src/signal_wrap.cc index 048a3de4beaece..d5bbddc8a025e7 100644 --- a/src/signal_wrap.cc +++ b/src/signal_wrap.cc @@ -19,12 +19,10 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" #include "env-inl.h" #include "handle_wrap.h" -#include "util.h" #include "util-inl.h" #include "v8.h" diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h index 562af2a53325dd..667c0a9ffbd50d 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -6,7 +6,6 @@ #include "stream_base.h" #include "node.h" -#include "env.h" #include "env-inl.h" #include "v8.h" diff --git a/src/stream_base.cc b/src/stream_base.cc index a923fc669fd13c..c6aca1694f9568 100644 --- a/src/stream_base.cc +++ b/src/stream_base.cc @@ -1,14 +1,11 @@ -#include "stream_base.h" #include "stream_base-inl.h" #include "stream_wrap.h" #include "node.h" #include "node_buffer.h" -#include "env.h" #include "env-inl.h" #include "js_stream.h" #include "string_bytes.h" -#include "util.h" #include "util-inl.h" #include "v8.h" diff --git a/src/stream_base.h b/src/stream_base.h index 1b486e61db150e..9833a82636d28e 100644 --- a/src/stream_base.h +++ b/src/stream_base.h @@ -5,7 +5,6 @@ #include "env.h" #include "async-wrap.h" -#include "req-wrap.h" #include "req-wrap-inl.h" #include "node.h" #include "util.h" diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index 0107cbad2d9196..c2915ac453ea33 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -20,7 +20,6 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. #include "stream_wrap.h" -#include "stream_base.h" #include "stream_base-inl.h" #include "env-inl.h" @@ -29,11 +28,9 @@ #include "node_buffer.h" #include "node_counters.h" #include "pipe_wrap.h" -#include "req-wrap.h" #include "req-wrap-inl.h" #include "tcp_wrap.h" #include "udp_wrap.h" -#include "util.h" #include "util-inl.h" #include // abort() diff --git a/src/string_bytes.h b/src/string_bytes.h index e46fa8227b7236..0e38e017ab2f41 100644 --- a/src/string_bytes.h +++ b/src/string_bytes.h @@ -28,7 +28,6 @@ #include "v8.h" #include "node.h" -#include "env.h" #include "env-inl.h" #include "util.h" diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index fdb8244bf6ac24..ce86108cb0acbb 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -22,14 +22,12 @@ #include "tcp_wrap.h" #include "connection_wrap.h" -#include "env.h" #include "env-inl.h" #include "handle_wrap.h" #include "node_buffer.h" #include "node_wrap.h" #include "connect_wrap.h" #include "stream_wrap.h" -#include "util.h" #include "util-inl.h" #include diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc index e398a471e74242..08701b4ff08d55 100644 --- a/src/timer_wrap.cc +++ b/src/timer_wrap.cc @@ -19,12 +19,10 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" #include "env-inl.h" #include "handle_wrap.h" -#include "util.h" #include "util-inl.h" #include diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 63e3494047a21e..3315267330afa2 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -20,16 +20,14 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tls_wrap.h" -#include "async-wrap.h" #include "async-wrap-inl.h" #include "node_buffer.h" // Buffer #include "node_crypto.h" // SecureContext #include "node_crypto_bio.h" // NodeBIO -#include "node_crypto_clienthello.h" // ClientHelloParser +// ClientHelloParser #include "node_crypto_clienthello-inl.h" #include "node_counters.h" #include "node_internals.h" -#include "stream_base.h" #include "stream_base-inl.h" namespace node { diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index ca84008785829d..872a126c6d4ee4 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -21,15 +21,12 @@ #include "tty_wrap.h" -#include "env.h" #include "env-inl.h" #include "handle_wrap.h" #include "node_buffer.h" #include "node_wrap.h" -#include "req-wrap.h" #include "req-wrap-inl.h" #include "stream_wrap.h" -#include "util.h" #include "util-inl.h" namespace node { diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index b8c53534052f70..54f1b610238ff9 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -20,11 +20,9 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. #include "udp_wrap.h" -#include "env.h" #include "env-inl.h" #include "node_buffer.h" #include "handle_wrap.h" -#include "req-wrap.h" #include "req-wrap-inl.h" #include "util.h" #include "util-inl.h" diff --git a/src/udp_wrap.h b/src/udp_wrap.h index 5be603d62e31e2..fe9256bcc63a05 100644 --- a/src/udp_wrap.h +++ b/src/udp_wrap.h @@ -27,7 +27,6 @@ #include "async-wrap.h" #include "env.h" #include "handle_wrap.h" -#include "req-wrap.h" #include "req-wrap-inl.h" #include "uv.h" #include "v8.h" diff --git a/src/uv.cc b/src/uv.cc index 3e345374a2ef74..fbe61c9b0164d7 100644 --- a/src/uv.cc +++ b/src/uv.cc @@ -21,7 +21,6 @@ #include "uv.h" #include "node.h" -#include "env.h" #include "env-inl.h" namespace node { From 91a2daadf4c606a896538b0c9d3d139fd9a0ff81 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 27 Oct 2017 16:30:31 +0800 Subject: [PATCH 2/3] doc: add *-inl.h include rule to C++ style guide PR-URL: https://github.com/nodejs/node/pull/16548 Reviewed-By: Ben Noordhuis Reviewed-By: Gireesh Punathil Reviewed-By: Daniel Bevenius Reviewed-By: Gibson Fahnestock Reviewed-By: Colin Ihrig --- CPP_STYLE_GUIDE.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CPP_STYLE_GUIDE.md b/CPP_STYLE_GUIDE.md index 3e7319c1f8e8f7..3bea5bb107586f 100644 --- a/CPP_STYLE_GUIDE.md +++ b/CPP_STYLE_GUIDE.md @@ -127,6 +127,21 @@ class FancyContainer { What it says in the title. +## Do not include `*.h` if `*-inl.h` has already been included + +Do + +```cpp +#include "util-inl.h" // already includes util.h +``` + +instead of + +```cpp +#include "util.h" +#include "util-inl.h" +``` + ## Avoid throwing JavaScript errors in nested C++ methods If you need to throw JavaScript errors from a C++ binding method, try to do it From d735be94bf2c717b3026a685ecf2fa20b8c13ffb Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 31 Oct 2017 20:27:18 +0800 Subject: [PATCH 3/3] src: fix etw provider include on Windows PR-URL: https://github.com/nodejs/node/pull/16639 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- src/node_win32_etw_provider.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node_win32_etw_provider.cc b/src/node_win32_etw_provider.cc index 11694d7d0e43ea..8a854767d6aed8 100644 --- a/src/node_win32_etw_provider.cc +++ b/src/node_win32_etw_provider.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 "node_win32_etw_provider.h" #include "node_etw_provider.h" #include "node_win32_etw_provider-inl.h"