Skip to content

Commit 2a8ed98

Browse files
[wasm] Import wasi_emulated_mman with @_implementationOnly
The `wasi_emulated_mman` module must be imported with `@_implementationOnly` to avoid requiring Foundation users to enable `_WASI_EMULATED_MMAN` by themselves. "private import" does not work here because it still imports private dependencies.
1 parent eded784 commit 2a8ed98

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/Foundation/Data.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
@usableFromInline let memcpy = Musl.memcpy
3737
@usableFromInline let memcmp = Musl.memcmp
3838
#elseif canImport(WASILibc)
39-
#if swift(>=6.0)
40-
private import wasi_emulated_mman
41-
#else
42-
import wasi_emulated_mman
43-
#endif
39+
// `wasi_emulated_mman` must be imported with `@_implementationOnly` to avoid
40+
// requiring Foundation users to enable `_WASI_EMULATED_MMAN` by themselves.
41+
// "private import" does not work here because it still imports private
42+
// dependencies.
43+
@_implementationOnly import wasi_emulated_mman
4444
@usableFromInline let calloc = WASILibc.calloc
4545
@usableFromInline let malloc = WASILibc.malloc
4646
@usableFromInline let free = WASILibc.free

0 commit comments

Comments
 (0)