Skip to content

Instantly share code, notes, and snippets.

@TooTallNate
Created November 6, 2012 00:50
Show Gist options
  • Save TooTallNate/4021657 to your computer and use it in GitHub Desktop.
Save TooTallNate/4021657 to your computer and use it in GitHub Desktop.
Fix v8.h warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persist ent<T>::New(v8::Handle<T>)'. See http://www.parashift.com/c++-faq-lite/where-to-put-inline-keyword.html
diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h
index ddde388..e886314 100644
--- a/deps/v8/include/v8.h
+++ b/deps/v8/include/v8.h
@@ -323,7 +323,7 @@ template <class T> class Persistent : public Handle<T> {
* Creates an empty persistent handle that doesn't point to any
* storage cell.
*/
- inline Persistent();
+ Persistent();
/**
* Creates a persistent handle for the same storage cell as the
@@ -372,7 +372,7 @@ template <class T> class Persistent : public Handle<T> {
* Creates a new persistent handle for an existing local or
* persistent handle.
*/
- inline static Persistent<T> New(Handle<T> that);
+ static Persistent<T> New(Handle<T> that);
/**
* Releases the storage cell referenced by this persistent handle.
@@ -4154,7 +4154,7 @@ Local<T> Local<T>::New(Handle<T> that) {
template <class T>
-Persistent<T> Persistent<T>::New(Handle<T> that) {
+inline Persistent<T> Persistent<T>::New(Handle<T> that) {
if (that.IsEmpty()) return Persistent<T>();
internal::Object** p = reinterpret_cast<internal::Object**>(*that);
return Persistent<T>(reinterpret_cast<T*>(V8::GlobalizeReference(p)));
@@ -4183,7 +4183,7 @@ void Persistent<T>::Dispose() {
template <class T>
-Persistent<T>::Persistent() : Handle<T>() { }
+inline Persistent<T>::Persistent() : Handle<T>() { }
template <class T>
void Persistent<T>::MakeWeak(void* parameters, WeakReferenceCallback callback) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment