Skip to content

Commit d6ac8a4

Browse files
committed
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: nodejs#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>
1 parent d37789d commit d6ac8a4

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

src/node.h

-7
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,6 @@ typedef void (*addon_context_register_func)(
442442
v8::Local<v8::Context> context,
443443
void* priv);
444444

445-
#define NM_F_BUILTIN 0x01
446-
#define NM_F_LINKED 0x02
447-
#define NM_F_INTERNAL 0x04
448-
449445
struct node_module {
450446
int nm_version;
451447
unsigned int nm_flags;
@@ -529,9 +525,6 @@ extern "C" NODE_EXTERN void node_module_register(void* mod);
529525
#define NODE_MODULE_CONTEXT_AWARE(modname, regfunc) \
530526
NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
531527

532-
#define NODE_MODULE_CONTEXT_AWARE_BUILTIN(modname, regfunc) \
533-
NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, NM_F_BUILTIN) \
534-
535528
/*
536529
* For backward compatibility in add-on modules.
537530
*/

src/node_internals.h

+7
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
#define Z_MAX_LEVEL 9
5656
#define Z_DEFAULT_LEVEL Z_DEFAULT_COMPRESSION
5757

58+
enum {
59+
NM_F_BUILTIN = 1 << 0,
60+
NM_F_LINKED = 1 << 1,
61+
NM_F_INTERNAL = 1 << 2,
62+
};
63+
5864
struct sockaddr;
5965

6066
// Variation on NODE_DEFINE_CONSTANT that sets a String value.
@@ -115,6 +121,7 @@ struct sockaddr;
115121
V(stream_wrap) \
116122
V(tcp_wrap) \
117123
V(timer_wrap) \
124+
V(trace_events) \
118125
V(tty_wrap) \
119126
V(udp_wrap) \
120127
V(url) \

src/node_trace_events.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,4 @@ void InitializeTraceEvents(Local<Object> target,
133133

134134
} // namespace node
135135

136-
NODE_MODULE_CONTEXT_AWARE_BUILTIN(trace_events, node::InitializeTraceEvents)
136+
NODE_BUILTIN_MODULE_CONTEXT_AWARE(trace_events, node::InitializeTraceEvents)

test/cctest/node_module_reg.cc

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ void _register_spawn_sync() {}
2020
void _register_stream_wrap() {}
2121
void _register_tcp_wrap() {}
2222
void _register_timer_wrap() {}
23+
void _register_trace_events() {}
2324
void _register_tty_wrap() {}
2425
void _register_udp_wrap() {}
2526
void _register_util() {}

0 commit comments

Comments
 (0)