From 25a9eee9fd568950bd5cdebbc486e18ffff0e9df Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Wed, 24 Oct 2018 11:27:41 -0400 Subject: [PATCH] src: add direct dependency on `*-inl.h` file PR-URL: https://github.com/nodejs/node/pull/23808 Reviewed-By: Joyee Cheung Reviewed-By: Matheus Marchini --- src/inspector/main_thread_interface.cc | 1 + src/util-inl.h | 4 ++-- src/util.h | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/inspector/main_thread_interface.cc b/src/inspector/main_thread_interface.cc index d3f553caac8f9f..bb637d3a77f6fa 100644 --- a/src/inspector/main_thread_interface.cc +++ b/src/inspector/main_thread_interface.cc @@ -5,6 +5,7 @@ #include #include +#include "util-inl.h" namespace node { namespace inspector { diff --git a/src/util-inl.h b/src/util-inl.h index 9751f9babe1189..acd370e2358264 100644 --- a/src/util-inl.h +++ b/src/util-inl.h @@ -160,8 +160,8 @@ ContainerOfHelper::operator TypeName*() const { } template -inline ContainerOfHelper ContainerOf(Inner Outer::*field, - Inner* pointer) { +constexpr ContainerOfHelper ContainerOf(Inner Outer::*field, + Inner* pointer) { return ContainerOfHelper(field, pointer); } diff --git a/src/util.h b/src/util.h index f0d3189d1af2f2..086e33933e6b5a 100644 --- a/src/util.h +++ b/src/util.h @@ -198,8 +198,8 @@ class ContainerOfHelper { // Calculate the address of the outer (i.e. embedding) struct from // the interior pointer to a data member. template -inline ContainerOfHelper ContainerOf(Inner Outer::*field, - Inner* pointer); +constexpr ContainerOfHelper ContainerOf(Inner Outer::*field, + Inner* pointer); // Convenience wrapper around v8::String::NewFromOneByte(). inline v8::Local OneByteString(v8::Isolate* isolate,