Permalink
Browse files

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.
  • Loading branch information...
1 parent 6c999fd commit 772b3bf4c806f881528718d1e0240392d0228c19 @piscisaureus piscisaureus committed Aug 20, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/node_object_wrap.h
View
7 src/node_object_wrap.h
@@ -29,8 +29,11 @@
// Explicitly instantiate some template classes, so we're sure they will be
// present in the binary / shared object. There isn't much doubt that they will
// be, but MSVC tends to complain about these things.
-template class NODE_EXTERN v8::Persistent<v8::Object>;
-template class NODE_EXTERN v8::Persistent<v8::FunctionTemplate>;
+#ifdef _MSC_VER
+ template class NODE_EXTERN v8::Persistent<v8::Object>;
+ template class NODE_EXTERN v8::Persistent<v8::FunctionTemplate>;
+#endif
+
namespace node {

0 comments on commit 772b3bf

Please sign in to comment.