Skip to content

Commit 9d922c6

Browse files
danbevjasnell
authored andcommitted
src: fix InspectorStarted macro guard
Currently the InspectorStarted function is guarded by the else clause of the NODE_USE_V8_PLATFORM macro. If node is configured --without-ssl then NODE_USE_V8_PLATFORM will be 1 but the nested HAVE_INSPECTOR macro will not be 0 which will lead to that there will be no InspectorStarted function defined. If building --without-inspector or --without-ssl the following compilation error will occur: ../src/node.cc:4470:57: error: no member named 'InspectorStarted' in 'node::(anonymous struct at ../src/node.cc:241:8)' if (debug_options.inspector_enabled() && !v8_platform.InspectorStarted(&env)) ~~~~~~~~~~~ ^ ../src/node.cc:4470:57: error: no member named 'InspectorStarted' in 'node::(anonymous struct at ../src/node.cc:241:8)' if (debug_options.inspector_enabled() && !v8_platform.InspectorStarted(&env)) ~~~~~~~~~~~ ^ 1 error generated. This commit adds a separate if preprocessor directive to catch the case when either --without-ssl/--without-inspector and --without-v8-platform combinations are used to configure node. PR-URL: #13167 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent 2c5c2bd commit 9d922c6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/node.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,13 @@ static struct {
295295
"so event tracing is not available.\n");
296296
}
297297
void StopTracingAgent() {}
298+
#endif // !NODE_USE_V8_PLATFORM
299+
300+
#if !NODE_USE_V8_PLATFORM || !HAVE_INSPECTOR
298301
bool InspectorStarted(Environment *env) {
299302
return false;
300303
}
301-
#endif // !NODE_USE_V8_PLATFORM
304+
#endif // !NODE_USE_V8_PLATFORM || !HAVE_INSPECTOR
302305
} v8_platform;
303306

304307
#ifdef __POSIX__

0 commit comments

Comments
 (0)