Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
[addons] Fix inizialization order issue
Use construct on first use to avoid static inizialization order issues.
  • Loading branch information
agnat committed Aug 15, 2015
commit 1e9980977e09376d2d7e8b6b852a4d9da4b7e330
26 changes: 13 additions & 13 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,20 +504,20 @@ extern "C" NODE_EXTERN void node_module_register(void* mod);

#define NODE_MODULE_X(modname, initfunc, priv, flags) \
extern "C" { \
static node::node_module _module_ ## modname = \
{ \
NODE_MODULE_VERSION, \
flags, \
NULL, \
__FILE__, \
node::detail::selectAddonRegisterFunction(initfunc), \
reinterpret_cast<void*>(initfunc), \
NODE_STRINGIFY(modname), \
priv, \
NULL \
}; \
NODE_C_CTOR(_register_ ## modname) { \
node_module_register(&_module_ ## modname); \
static node::node_module _module = \
{ \
NODE_MODULE_VERSION, \
flags, \
NULL, \
__FILE__, \
node::detail::selectAddonRegisterFunction(initfunc), \
reinterpret_cast<void*>(initfunc), \
NODE_STRINGIFY(modname), \
priv, \
NULL \
}; \
node_module_register(&_module); \
} \
}

Expand Down