Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Define _WASI_EMULATED_MMAN to replace imports #4913

Commits on Mar 8, 2024

  1. [wasm] Import sys/mman.h through CoreFoundation

    Importing `wasi_emulated_mman` in Swift code requires the client to
    define `_WASI_EMULATED_MMAN`. `@_implementationOnly import` was the only
    way to work around this, but it's now declared as unsafe if it's used in
    non-resilient moules (even though it's actually safe as long as the
    module does not use type layout of the imported module).
    The new scoped import feature always requires the transitive clients to
    load privately imported modules, so it's not a good fit for this tricky
    case where a special macro must be defined before importing the module.
    
    This patch imports `sys/mman.h` through CoreFoundation while defining
    `_WASI_EMULATED_MMAN` in the header exposed by modulemap. This way, the
    clients don't need to define it.
    kateinoigakukun committed Mar 8, 2024
    Copy the full SHA
    90c1832 View commit details
    Browse the repository at this point in the history