Skip to content

Commit 0db1f87

Browse files
bnoordhuisMylesBorins
authored andcommitted
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Timothy Gu <[email protected]>
1 parent 347164a commit 0db1f87

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
@@ -456,10 +456,6 @@ typedef void (*addon_context_register_func)(
456456
v8::Local<v8::Context> context,
457457
void* priv);
458458

459-
#define NM_F_BUILTIN 0x01
460-
#define NM_F_LINKED 0x02
461-
#define NM_F_INTERNAL 0x04
462-
463459
struct node_module {
464460
int nm_version;
465461
unsigned int nm_flags;
@@ -543,9 +539,6 @@ extern "C" NODE_EXTERN void node_module_register(void* mod);
543539
#define NODE_MODULE_CONTEXT_AWARE(modname, regfunc) \
544540
NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
545541

546-
#define NODE_MODULE_CONTEXT_AWARE_BUILTIN(modname, regfunc) \
547-
NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, NM_F_BUILTIN) \
548-
549542
/*
550543
* For backward compatibility in add-on modules.
551544
*/

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
@@ -144,4 +144,4 @@ void InitializeTraceEvents(Local<Object> target,
144144

145145
} // namespace node
146146

147-
NODE_MODULE_CONTEXT_AWARE_BUILTIN(trace_events, node::InitializeTraceEvents)
147+
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)