diff options
author | Chad Austin <caustin@gmail.com> | 2014-03-24 02:16:42 -0700 |
---|---|---|
committer | Chad Austin <chad@chadaustin.me> | 2014-03-28 23:56:42 -0700 |
commit | 0ee1cab6034ce6ef51e9f612873603182dffa248 (patch) | |
tree | ddb0180330bba0ee012ba2375017eefe57c4ce7d /system/include | |
parent | 8770323ba3a088c9b557344c18123650a6eef409 (diff) |
Make val::val(T&&) compatible with asm.js
Diffstat (limited to 'system/include')
-rw-r--r-- | system/include/emscripten/val.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/system/include/emscripten/val.h b/system/include/emscripten/val.h index 3d956f24..74e4e702 100644 --- a/system/include/emscripten/val.h +++ b/system/include/emscripten/val.h @@ -26,8 +26,7 @@ namespace emscripten { EM_VAL _emval_null(); EM_VAL _emval_new_cstring(const char*); - // TODO: make compatible with asm.js - void _emval_take_value(TYPEID type/*, ...*/); + EM_VAL _emval_take_value(TYPEID type, ...); EM_VAL _emval_new( EM_VAL value, @@ -216,9 +215,12 @@ namespace emscripten { template<typename T> explicit val(T&& value) { + using namespace internal; + typedef internal::BindingType<T> BT; - auto taker = reinterpret_cast<internal::EM_VAL (*)(internal::TYPEID, typename BT::WireType)>(&internal::_emval_take_value); - handle = taker(internal::TypeID<T>::get(), BT::toWireType(std::forward<T>(value))); + handle = _emval_take_value( + internal::TypeID<T>::get(), + BT::toWireType(std::forward<T>(value))); } val() = delete; |