From d38d7bea6c08ba9b1367ebd44f9ade1154e3d04d Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Mon, 20 Aug 2012 19:13:05 +0300 Subject: [PATCH] unix: don't explicitly instantiate v8::Persistent 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. --- src/node_object_wrap.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/node_object_wrap.h b/src/node_object_wrap.h index 62ea2444858..32d584c849a 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; -template class NODE_EXTERN v8::Persistent; +#ifdef _MSC_VER + template class NODE_EXTERN v8::Persistent; + template class NODE_EXTERN v8::Persistent; +#endif + namespace node {