aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-03-19 03:11:45 -0700
committerJukka Jylänki <jujjyl@gmail.com>2013-04-12 14:26:12 +0300
commit09effb641c418d7b8751b04f215d7192075b72cb (patch)
tree6a0001bd5b22548272c375bd126ffb9e8cb9a308 /system
parent9ec4c29864a967186156a95a9ec8062d05ffa3c9 (diff)
Simplify upcasting/downcasting, allow multiple smart pointer types per class, and use the same ClassHandle prototype so class handles and smart pointer handles share implementations for .clone() and .delete()
Diffstat (limited to 'system')
-rwxr-xr-xsystem/include/emscripten/bind.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h
index cd208d37..a1b2a015 100755
--- a/system/include/emscripten/bind.h
+++ b/system/include/emscripten/bind.h
@@ -117,7 +117,6 @@ namespace emscripten {
GenericFunction getActualType,
GenericFunction upcast,
GenericFunction downcast,
- bool isPolymorphic,
const char* className,
GenericFunction destructor);
@@ -650,9 +649,11 @@ namespace emscripten {
}
};
+ // NOTE: this returns the class type, not the pointer type
template<typename T>
inline TYPEID getActualType(T* ptr) {
- return reinterpret_cast<TYPEID>(&typeid(ptr));
+ assert(ptr);
+ return reinterpret_cast<TYPEID>(&typeid(*ptr));
};
}
@@ -720,7 +721,6 @@ namespace emscripten {
reinterpret_cast<GenericFunction>(&getActualType<ClassType>),
BaseSpecifier::template getUpcaster<ClassType>(),
BaseSpecifier::template getDowncaster<ClassType>(),
- std::is_polymorphic<ClassType>::value, // TODO: may not be necessary
name,
reinterpret_cast<GenericFunction>(&raw_destructor<ClassType>));
}