emscripten-core / emscripten-core/emscripten
EM_JS and function pointers
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
Our argument name parsing is too simple to support inline function pointer signatures
https://github.com/emscripten-core/emscripten/blob/1488c44c521c3d312028a81cf314ed6c8562b2c9/emscripten.py#L2449
```c++
EM_JS(void, fails, (int (f*)(int)), {...});
#define workaround_arg int (f*)(int)
EM_JS(void, workaround_A, (workaround_arg), {...});
typedef int (F_ii*)(int);
EM_JS(void, workaround_B, (F_ii f), {...});
```
The first one gets the wrong argument name, the second is clunky. Ideally this would just work, but would require either more clever parsing in emscripten.py, or tighter integration with Clang (possibly via a plugin?)
Contributor guide
Assessment
This issue has not been assessed yet.