Skip to content

Commit aa63e02

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. Backport-PR-URL: #18179 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 36dbd11 commit aa63e02

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/node.h

-8
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,6 @@ typedef void (*addon_context_register_func)(
425425
v8::Local<v8::Context> context,
426426
void* priv);
427427

428-
#define NM_F_BUILTIN 0x01
429-
#define NM_F_LINKED 0x02
430-
#define NM_F_INTERNAL 0x04
431-
432428
struct node_module {
433429
int nm_version;
434430
unsigned int nm_flags;
@@ -513,10 +509,6 @@ extern "C" NODE_EXTERN void node_module_register(void* mod);
513509
/* NOLINTNEXTLINE (readability/null_usage) */ \
514510
NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
515511

516-
#define NODE_MODULE_CONTEXT_AWARE_BUILTIN(modname, regfunc) \
517-
/* NOLINTNEXTLINE (readability/null_usage) */ \
518-
NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, NM_F_BUILTIN) \
519-
520512
/*
521513
* For backward compatibility in add-on modules.
522514
*/

src/node_internals.h

+7
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838

3939
#include <string>
4040

41+
enum {
42+
NM_F_BUILTIN = 1 << 0,
43+
NM_F_LINKED = 1 << 1,
44+
NM_F_INTERNAL = 1 << 2,
45+
};
46+
4147
struct sockaddr;
4248

4349
// Variation on NODE_DEFINE_CONSTANT that sets a String value.
@@ -98,6 +104,7 @@ struct sockaddr;
98104
V(stream_wrap) \
99105
V(tcp_wrap) \
100106
V(timer_wrap) \
107+
V(trace_events) \
101108
V(tty_wrap) \
102109
V(udp_wrap) \
103110
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)