-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[embind] Fix signature for 64 bit types. #22930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #include <cstdint> | ||
| #include <emscripten.h> | ||
| #include <emscripten/bind.h> | ||
|
|
||
| int64_t getBigInt() { | ||
| return 1000000000000; | ||
| } | ||
|
|
||
| uint64_t getBigUInt() { | ||
| return -1000000000000; | ||
| } | ||
|
|
||
| int main() { | ||
| EM_ASM( | ||
| console.log(Module.getBigInt()); | ||
| console.log(Module.getBigUInt()); | ||
| ); | ||
| } | ||
|
|
||
| EMSCRIPTEN_BINDINGS(my_module) { | ||
| emscripten::function("getBigInt", &getBigInt); | ||
| emscripten::function("getBigUInt", &getBigUInt); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3296,6 +3296,14 @@ def test_embind_return_value_policy(self): | |
|
|
||
| self.do_runf('embind/test_return_value_policy.cpp') | ||
|
|
||
| @parameterized({ | ||
| '': [[]], | ||
| 'asyncify': [['-sASYNCIFY=1']] | ||
| }) | ||
| def test_embind_long_long(self, args): | ||
| self.do_runf('embind/test_embind_long_long.cpp', '1000000000000n\n-1000000000000n', | ||
| emcc_args=['-lembind', '-sWASM_BIGINT'] + args) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow I guess we just never had anyone try this before? Why does this require
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems only ASYNCIFY exposed this because it uses the signature to create a DYNCALL with the legacy mode. Without asyncify bigints were working fine. |
||
|
|
||
| @requires_jspi | ||
| @parameterized({ | ||
| '': [['-sJSPI_EXPORTS=async*']], | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
getUint64? OrgetLongLong