File tree 3 files changed +40
-0
lines changed
system/include/emscripten
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> {
607
607
}
608
608
};
609
609
610
+ template <>
611
+ struct SignatureCode <long long > {
612
+ static constexpr char get () {
613
+ return ' j' ;
614
+ }
615
+ };
616
+
610
617
#ifdef __wasm64__
611
618
template <>
612
619
struct SignatureCode <long > {
@@ -629,6 +636,8 @@ template<> struct SignatureTranslator<double> { using type = double; };
629
636
#ifdef __wasm64__
630
637
template <> struct SignatureTranslator <long > { using type = long ; };
631
638
#endif
639
+ template <> struct SignatureTranslator <long long > { using type = long long ; };
640
+ template <> struct SignatureTranslator <unsigned long long > { using type = long long ; };
632
641
template <> struct SignatureTranslator <size_t > { using type = size_t ; };
633
642
template <typename PtrType>
634
643
struct 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):
3320
3320
3321
3321
self.do_runf('embind/test_return_value_policy.cpp')
3322
3322
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
+
3323
3331
@requires_jspi
3324
3332
@parameterized({
3325
3333
'': [['-sJSPI_EXPORTS=async*']],
You can’t perform that action at this time.
0 commit comments