summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Belder <info@2bs.nl>2012-08-20 19:13:05 +0300
committerBert Belder <info@2bs.nl>2012-08-20 19:13:05 +0300
commit772b3bf4c806f881528718d1e0240392d0228c19 (patch)
tree46677c4f9f5662a2a578174b2bd3c943f28fb388
parent6c999fd2855f9bccf99666431cddc9b34930720b (diff)
downloadandroid-node-v8-772b3bf4c806f881528718d1e0240392d0228c19.tar.gz
android-node-v8-772b3bf4c806f881528718d1e0240392d0228c19.tar.bz2
android-node-v8-772b3bf4c806f881528718d1e0240392d0228c19.zip
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.
-rw-r--r--src/node_object_wrap.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/node_object_wrap.h b/src/node_object_wrap.h
index 62ea244485..32d584c849 100644
--- a/src/node_object_wrap.h
+++ b/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 {