File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
system/include/emscripten Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -607,6 +607,13 @@ struct SignatureCode<size_t> {
607607 }
608608};
609609
610+ template <>
611+ struct SignatureCode <long long > {
612+ static constexpr char get () {
613+ return ' j' ;
614+ }
615+ };
616+
610617#ifdef __wasm64__
611618template <>
612619struct SignatureCode <long > {
@@ -629,6 +636,8 @@ template<> struct SignatureTranslator<double> { using type = double; };
629636#ifdef __wasm64__
630637template <> struct SignatureTranslator <long > { using type = long ; };
631638#endif
639+ template <> struct SignatureTranslator <long long > { using type = long long ; };
640+ template <> struct SignatureTranslator <unsigned long long > { using type = long long ; };
632641template <> struct SignatureTranslator <size_t > { using type = size_t ; };
633642template <typename PtrType>
634643struct SignatureTranslator <PtrType*> { using type = void *; };
Original file line number Diff line number Diff line change 1+ #include < cstdint>
2+ #include < emscripten.h>
3+ #include < emscripten/bind.h>
4+
5+ int64_t getInt64 () {
6+ return 1000000000000 ;
7+ }
8+
9+ uint64_t getUint64 () {
10+ return -1000000000000 ;
11+ }
12+
13+ int main () {
14+ EM_ASM (
15+ console.log (Module.getInt64 ());
16+ console.log (Module.getUint64 ());
17+ );
18+ }
19+
20+ EMSCRIPTEN_BINDINGS (my_module) {
21+ emscripten::function (" getInt64" , &getInt64);
22+ emscripten::function (" getUint64" , &getUint64);
23+ }
Original file line number Diff line number Diff line change @@ -3320,6 +3320,14 @@ def test_embind_return_value_policy(self):
33203320
33213321 self.do_runf('embind/test_return_value_policy.cpp')
33223322
3323+ @parameterized({
3324+ '': [[]],
3325+ 'asyncify': [['-sASYNCIFY=1']]
3326+ })
3327+ def test_embind_long_long(self, args):
3328+ self.do_runf('embind/test_embind_long_long.cpp', '1000000000000n\n-1000000000000n',
3329+ emcc_args=['-lembind', '-sWASM_BIGINT'] + args)
3330+
33233331 @requires_jspi
33243332 @parameterized({
33253333 '': [['-sJSPI_EXPORTS=async*']],
You can’t perform that action at this time.
0 commit comments