瀏覽代碼

Merge pull request #47 from stesie/fix-copy-trait-inline

Fix CopyablePersistentTraits for v8 3.21.15 .. 3.21.18.x
Patrick Reilly 11 年之前
父節點
當前提交
09f5fd2ede
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      v8js_convert.cc

+ 7 - 1
v8js_convert.cc

@@ -37,8 +37,14 @@ namespace v8 {
 		typedef Persistent<T, CopyablePersistentTraits<T> > CopyablePersistent;
 		static const bool kResetInDestructor = true;
 		template<class S, class M>
+#if PHP_V8_API_VERSION >= 3021015
+		static V8_INLINE void Copy(const Persistent<S, M>& source,
+								   CopyablePersistent* dest)
+#else
 		V8_INLINE(static void Copy(const Persistent<S, M>& source,
-								   CopyablePersistent* dest)) {
+								   CopyablePersistent* dest))
+#endif
+		{
 			// do nothing, just allow copy
 		}
 	};