diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2014-03-04 14:10:05 +0100 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2014-03-05 15:26:09 +0400 |
commit | bd8a5755dceda415eee147bc06574f5a30abb0d0 (patch) | |
tree | c000bd57c005b2ae6c852220d3fd6ccee7a1b7a5 | |
parent | 6eb4d1d15ca8d2b82cf9db99d56633357ccc3320 (diff) | |
download | android-node-v8-bd8a5755dceda415eee147bc06574f5a30abb0d0.tar.gz android-node-v8-bd8a5755dceda415eee147bc06574f5a30abb0d0.tar.bz2 android-node-v8-bd8a5755dceda415eee147bc06574f5a30abb0d0.zip |
src: add default visibility to NODE_MODULE
It's currently not really possible to compile native add-ons with
-fvisibility=hidden because that also hides the struct containing
the module definition.
The NODE_MODULE() and NODE_MODULE_DECL() macros are structured in
a way that makes it impossible to add a visibility attribute manually
so there is no escape hatch there.
That's why this commit adds an explicit visibility attribute to
the module definition. It doesn't help with node.js releases that
are already out there but at least it improves the situation going
forward.
-rw-r--r-- | src/node.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node.h b/src/node.h index b2c8fc4c20..199aadfaca 100644 --- a/src/node.h +++ b/src/node.h @@ -217,7 +217,7 @@ node_module_struct* get_builtin_module(const char *name); #ifdef _WIN32 # define NODE_MODULE_EXPORT __declspec(dllexport) #else -# define NODE_MODULE_EXPORT /* empty */ +# define NODE_MODULE_EXPORT __attribute__((visibility("default"))) #endif #define NODE_MODULE(modname, regfunc) \ |