Skip to content

Commit 772b3bf

Browse files
committed
unix: don't explicitly instantiate v8::Persistent<x> templates
These explicit instantiations were added to make MSVC happy. It turns out that some older versions of gcc and llvm now complain about duplicate symbols, so we instantiate these templates only when MSVC is used.
1 parent 6c999fd commit 772b3bf

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/node_object_wrap.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@
2929
// Explicitly instantiate some template classes, so we're sure they will be
3030
// present in the binary / shared object. There isn't much doubt that they will
3131
// be, but MSVC tends to complain about these things.
32-
template class NODE_EXTERN v8::Persistent<v8::Object>;
33-
template class NODE_EXTERN v8::Persistent<v8::FunctionTemplate>;
32+
#ifdef _MSC_VER
33+
template class NODE_EXTERN v8::Persistent<v8::Object>;
34+
template class NODE_EXTERN v8::Persistent<v8::FunctionTemplate>;
35+
#endif
36+
3437

3538
namespace node {
3639

0 commit comments

Comments
 (0)