BUILDING_NODE_EXTENSION macro

145 views
Skip to first unread message

blazs

unread,
Dec 5, 2014, 5:08:22 AM12/5/14
to nod...@googlegroups.com
Is it necessary for Node.js (version 0.11+) addons to define BUILDING_NODE_EXTENSION macro? The compiler warns me that the macro is enabled by default.

Examples in the Addons Documentation define this macro. Is this deprecated? 

Cheers,
Blaz.

julien...@joyent.com

unread,
Dec 5, 2014, 1:58:00 PM12/5/14
to nod...@googlegroups.com
Hi,


On Friday, December 5, 2014 2:08:22 AM UTC-8, blazs wrote:
Is it necessary for Node.js (version 0.11+) addons to define BUILDING_NODE_EXTENSION macro? The compiler warns me that the macro is enabled by default.


The macro is defined on the command line by node-gyp. You can see that by setting "V" to "1" when running node-gyp:

node-gyp build V=1

To be safe, you could define it like following:

#ifndef BUILDING_NODE_EXTENSION
#define BUILDING_NODE_EXTENSION 1
#endif /* BUILDING_NODE_EXTENSION */
 
Examples in the Addons Documentation define this macro. Is this deprecated? 

You can find the binary add-ons documentation that matches the latest unstable release here:
I haven't tested the examples, but they do not define BUILDING_NODE_EXTENSION.

Please let us know if that helps. If you find any problem in the binary add-ons documentation,
please file an issue at https://github.com/joyent/node/issues.

Thank you!
Reply all
Reply to author
Forward
0 new messages