|
consider this function from lxw_error worksheet_write_string(lxw_worksheet *worksheet, lxw_row_t row, lxw_col_t col, const char *string, lxw_format *format);now imagine I'm inside const ptr = stringToNewUTF8(cells[j].firstElementChild.value);
_worksheet_write_string(ws, i, j++, ptr, NULL);
_free(ptr);but what should I pass instead of NULL, in a way that is reliable, that is, won't break in the future, the correct way?
please also adding this information in https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html#interacting-with-code-direct-function-calls |
Answered by
sbc100
Jan 26, 2026
Replies: 1 comment 3 replies
|
We don't define any special JS value for NULL. The number 0 is probably your best bet, although |
3 replies
Answer selected by
bottle2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We don't define any special JS value for NULL.
The number 0 is probably your best bet, although
nullandundefinedwill both work since they becoming the number 0 when passed to a wasm function expectingi32(which is the wasm type the represents a pointer).