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 b1ffbdc commit d38d7bea6c08ba9b1367ebd44f9ade1154e3d04d @piscisaureus piscisaureus committed with piscisaureus Aug 20, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/node_object_wrap.h
View
@@ -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 d38d7be

Please sign in to comment.