Permalink
Browse files

src: use NODE_BUILTIN_MODULE_CONTEXT_AWARE() macro

Commit d217b28 ("async_hooks: add trace events to async_hooks")
used `NODE_MODULE_CONTEXT_AWARE_BUILTIN()` instead.

After commit 8680bb9 ("src: explicitly register built-in modules")
it no longer works for static library builds so remove it.

PR-URL: #17071
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
  • Loading branch information...
bnoordhuis committed Nov 16, 2017
1 parent d37789d commit d6ac8a4db0c0a588258f594dc21fbd8018bef7c2
Showing with 9 additions and 8 deletions.
  1. +0 −7 src/node.h
  2. +7 −0 src/node_internals.h
  3. +1 −1 src/node_trace_events.cc
  4. +1 −0 test/cctest/node_module_reg.cc
View
@@ -442,10 +442,6 @@ typedef void (*addon_context_register_func)(
v8::Local<v8::Context> context,
void* priv);
#define NM_F_BUILTIN 0x01
#define NM_F_LINKED 0x02
#define NM_F_INTERNAL 0x04
struct node_module {
int nm_version;
unsigned int nm_flags;
@@ -529,9 +525,6 @@ extern "C" NODE_EXTERN void node_module_register(void* mod);
#define NODE_MODULE_CONTEXT_AWARE(modname, regfunc) \
NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
#define NODE_MODULE_CONTEXT_AWARE_BUILTIN(modname, regfunc) \
NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, NM_F_BUILTIN) \
/*
* For backward compatibility in add-on modules.
*/
View
@@ -55,6 +55,12 @@
#define Z_MAX_LEVEL 9
#define Z_DEFAULT_LEVEL Z_DEFAULT_COMPRESSION
enum {
NM_F_BUILTIN = 1 << 0,
NM_F_LINKED = 1 << 1,
NM_F_INTERNAL = 1 << 2,
};
struct sockaddr;
// Variation on NODE_DEFINE_CONSTANT that sets a String value.
@@ -115,6 +121,7 @@ struct sockaddr;
V(stream_wrap) \
V(tcp_wrap) \
V(timer_wrap) \
V(trace_events) \
V(tty_wrap) \
V(udp_wrap) \
V(url) \
View
@@ -133,4 +133,4 @@ void InitializeTraceEvents(Local<Object> target,
} // namespace node
NODE_MODULE_CONTEXT_AWARE_BUILTIN(trace_events, node::InitializeTraceEvents)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(trace_events, node::InitializeTraceEvents)
@@ -20,6 +20,7 @@ void _register_spawn_sync() {}
void _register_stream_wrap() {}
void _register_tcp_wrap() {}
void _register_timer_wrap() {}
void _register_trace_events() {}
void _register_tty_wrap() {}
void _register_udp_wrap() {}
void _register_util() {}

0 comments on commit d6ac8a4

Please sign in to comment.