forked from emscripten-core/emscripten
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix exporting a specific dynCall_* method (emscripten-core#6046)
* add a test for calling dynCall_[specific]
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include <emscripten.h> | ||
|
||
void waka(int x, int y, int z) { | ||
EM_ASM({ | ||
Module['print']('received ' + [$0, $1, $2] + '.'); | ||
}, x, y, z); | ||
} | ||
|
||
int main() { | ||
EM_ASM({ | ||
#if DIRECT | ||
dynCall_viii($0, 1, 4, 9); | ||
return; | ||
#endif | ||
#if EXPORTED | ||
Module['dynCall_viii']($0, 1, 4, 9); | ||
return; | ||
#endif | ||
#if FROM_OUTSIDE | ||
eval("Module['dynCall_viii'](" + $0 + ", 1, 4, 9)"); | ||
return; | ||
#endif | ||
throw "no test mode"; | ||
}, &waka); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
received 1,4,9. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters