Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Export modules' DSO constructors.
Browse files Browse the repository at this point in the history
We need to reference DSO constructors to make sure they can actually be
linked to the final binary, see http://git.io/DRIqCg.
  • Loading branch information
zcbenz committed Feb 18, 2016
1 parent 16c9e8e commit 0828dfa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,14 @@ extern "C" NODE_EXTERN void node_module_register(void* mod);
#if defined(_MSC_VER)
#pragma section(".CRT$XCU", read)
#define NODE_C_CTOR(fn) \
static void __cdecl fn(void); \
void __cdecl fn(void); \
__declspec(dllexport, allocate(".CRT$XCU")) \
void (__cdecl*fn ## _)(void) = fn; \
static void __cdecl fn(void)
void __cdecl fn(void)
#else
#define NODE_C_CTOR(fn) \
static void fn(void) __attribute__((constructor)); \
static void fn(void)
void fn(void) __attribute__((constructor)); \
void fn(void)
#endif

#define NODE_MODULE_X(modname, regfunc, priv, flags) \
Expand Down

0 comments on commit 0828dfa

Please sign in to comment.