Skip to content

Conversation

@alexcrichton
Copy link
Collaborator

This commit updates wasi/api.h to be fully undefined on WASIp2 targets. This prevents leaking WASIp1 definitions on unapplicable targets, such as wasm32-wasip2 and the upcoming wasm32-wasip3.

This involved changing a number of #defines from something symbolic to a number literal. Static assertions throughout the codebase, already present, assert that these numbers match WASIp1 ABI values and for WASIp2+ these numbers are just a libc abstraction, not part of the ABI.

This commit updates `wasi/api.h` to be fully undefined on WASIp2
targets. This prevents leaking WASIp1 definitions on unapplicable
targets, such as `wasm32-wasip2` and the upcoming `wasm32-wasip3`.

This involved changing a number of `#define`s from something symbolic to
a number literal. Static assertions throughout the codebase, already
present, assert that these numbers match WASIp1 ABI values and for
WASIp2+ these numbers are just a libc abstraction, not part of the ABI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant