diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2019-05-22 12:12:36 -0700 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-05-26 17:09:45 +0200 |
commit | 02f9a0fe27a70062631a39971099e13f54d2b588 (patch) | |
tree | 17561268145e62e01e8cdb0f8a4c5d4f9b204af9 /src/diagnosticfilename-inl.h | |
parent | 91ec5bf7ba78039b6ab856c87aa39e3b7ef77c7e (diff) | |
download | android-node-v8-02f9a0fe27a70062631a39971099e13f54d2b588.tar.gz android-node-v8-02f9a0fe27a70062631a39971099e13f54d2b588.tar.bz2 android-node-v8-02f9a0fe27a70062631a39971099e13f54d2b588.zip |
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 <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/diagnosticfilename-inl.h')
-rw-r--r-- | src/diagnosticfilename-inl.h | 33 |
1 files changed, 33 insertions, 0 deletions
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_ |