From 02f9a0fe27a70062631a39971099e13f54d2b588 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Wed, 22 May 2019 12:12:36 -0700 Subject: src: move DiagnosticFilename inlines into a -inl.h DiagnosticFilename's constructor default values use inlines from env-inl.h, causing the many users of node_internals.h to include env-inl.h, even if they never use DiagnosticFilename. PR-URL: https://github.com/nodejs/node/pull/27839 Reviewed-By: Colin Ihrig Reviewed-By: Michael Dawson Reviewed-By: James M Snell Reviewed-By: Rich Trott --- src/diagnosticfilename-inl.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/diagnosticfilename-inl.h (limited to 'src/diagnosticfilename-inl.h') diff --git a/src/diagnosticfilename-inl.h b/src/diagnosticfilename-inl.h new file mode 100644 index 0000000000..58a3a933ac --- /dev/null +++ b/src/diagnosticfilename-inl.h @@ -0,0 +1,33 @@ +#ifndef SRC_DIAGNOSTICFILENAME_INL_H_ +#define SRC_DIAGNOSTICFILENAME_INL_H_ + +#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + +#include "node_internals.h" +#include "env-inl.h" + +namespace node { + +inline DiagnosticFilename::DiagnosticFilename( + Environment* env, + const char* prefix, + const char* ext) : + filename_(MakeFilename(env->thread_id(), prefix, ext)) { +} + +inline DiagnosticFilename::DiagnosticFilename( + uint64_t thread_id, + const char* prefix, + const char* ext) : + filename_(MakeFilename(thread_id, prefix, ext)) { +} + +inline const char* DiagnosticFilename::operator*() const { + return filename_.c_str(); +} + +} // namespace node + +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + +#endif // SRC_DIAGNOSTICFILENAME_INL_H_ -- cgit v1.2.3