Implement cbool for emscripten_set_main_loop to reflect recent emsdk change #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is related to and resolves issue #129 for me.
Emsdk recently changed the type signature for emscripten_set_main_loop specifically changing the argument from int to bool. There exists an issue when linking emscripten in regards to the definition of a ctype for bool. Nim language has proper support for the bool (boolean) C99 type however the function definitions use custom defined types to match the fact that WASM thunks everything to int32? Either way by adding a cbool type which corresponds to the "bool" declared in emsdk function definition the linking now doesnt fail.
emsdk breaking change
I spoke to the nimlang developers in matrix chat that pointed me to the proper definition for bool internal to nim language so it lead me to believe that its related to nico. though adding the same cbool declaration to nim/system/ctypes.nim also alleviated the issue I feel a bit out of my depth here in the sense that I cant fully articulate where the problem is.
Also spoke to the emsdk developer who made the change. Investigating how to write tests for this or where to look.