aboutsummaryrefslogtreecommitdiff
path: root/system/lib/embind/bind.cpp
diff options
context:
space:
mode:
authorBill Welden <bwelden@imvu.com>2013-01-08 10:33:53 -0800
committerJukka Jylänki <jujjyl@gmail.com>2013-04-12 14:23:01 +0300
commitcfb3df1b48f9e1b9c59fd27e0d2608c7fe29a78e (patch)
tree48e3be86837fb28db884ba70295add3bc0ad1d5a /system/lib/embind/bind.cpp
parent84b49c917c177e9fa49798b45a543f3ce68bf30b (diff)
Revert "Revert "Auto upcast of pointer parameters to C++ routines.""
This reverts commit 07e0daa5aab716b38acf9041a8baec3816976579.
Diffstat (limited to 'system/lib/embind/bind.cpp')
-rwxr-xr-xsystem/lib/embind/bind.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/system/lib/embind/bind.cpp b/system/lib/embind/bind.cpp
index 46924505..a4b67fa5 100755
--- a/system/lib/embind/bind.cpp
+++ b/system/lib/embind/bind.cpp
@@ -190,8 +190,6 @@ namespace emscripten {
// __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) {
- // The final parameter is a place-holder for a hint, a feature which is not currently implemented
- // in the emscripten runtime. The compiler passes a dummy value of -1, and so do we.
int ret = (int)__staticPointerCast((void *)p, __getDynamicPointerType(p), to);
if (ret < 0) {
return 0;
@@ -214,11 +212,16 @@ namespace emscripten {
return name;
}
+ int EMSCRIPTEN_KEEPALIVE __peek32(int p) {
+ return *(int *)p;
+ }
+
EMSCRIPTEN_BINDINGS(([]() {
// We bind __getDerivationPath in order to take advantage of the std::vector to Javascript array
// conversion for the return value. This has the unfortunate side-effect of exposing it to third party
// developers, but perhaps the double underscore will scare them away from calling it.
function("__getDerivationPath", &__getDerivationPath);
+ function("__peek32", &__peek32);
}));
}