Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: use NODE_BUILTIN_MODULE_CONTEXT_AWARE() macro #17071

Merged
merged 1 commit into from
Nov 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*/
Expand Down
7 changes: 7 additions & 0 deletions src/node_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) \
Expand Down
2 changes: 1 addition & 1 deletion src/node_trace_events.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions test/cctest/node_module_reg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down