diff options
Diffstat (limited to 'system/lib/embind/bind.cpp')
-rwxr-xr-x | system/lib/embind/bind.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/system/lib/embind/bind.cpp b/system/lib/embind/bind.cpp index 5e82bb7e..bc79876f 100755 --- a/system/lib/embind/bind.cpp +++ b/system/lib/embind/bind.cpp @@ -101,7 +101,7 @@ namespace emscripten { // __getDerivationPath returns an array of type_info pointers describing the derivation chain starting with
// the derived type and proceeding toward (and ending with) the base type. Types are only included if they
// appear on all possible derivation paths.
- std::vector<int> __getDerivationPath(int dv, const int bs) {
+ std::vector<int> __getDerivationPath(int dv, const int bs) { // todo: use emval array to pass return value??
std::vector<std::vector<const __cxxabiv1::__class_type_info*>> paths;
const std::type_info* dv1 = (std::type_info*)dv;
@@ -176,27 +176,11 @@ namespace emscripten { // __getDynamicPointerType returns (for polymorphic types only!) the type of the instance actually
// pointed to.
- int EMSCRIPTEN_KEEPALIVE __getDynamicPointerType(int p) {
+ int EMSCRIPTEN_KEEPALIVE __getDynamicPointerType(int p) { // use size_t
void** vtable = *(void***)p;
return (int)static_cast<const std::type_info*>(vtable[-1]);
}
- // Calls to __dynamic_cast are generated by the compiler to implement dynamic_cast<>() -- its prototype is
- // not available through any header file. It is called directly here because it allows run-time
- // specification of the target pointer type (which can only be specified at compile time when using
- // dynamic_cast<>().
- void* __dynamic_cast(void*, const std::type_info*, const std::type_info*, int);
-
- // __dynamicPointerCast performs a C++ dynamic_cast<>() operation, but allowing run-time specification of
- // the from and to pointer types.
- int EMSCRIPTEN_KEEPALIVE __dynamicPointerCast(int p, int to) {
- int ret = (int)__staticPointerCast((void *)p, __getDynamicPointerType(p), to);
- if (ret < 0) {
- return 0;
- }
- return ret;
- }
-
const char* EMSCRIPTEN_KEEPALIVE __typeName(int p) {
const std::type_info* ti = (const std::type_info*)p;
size_t nameLen = std::min(strlen(ti->name()), (unsigned int)1024);
|