Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CoreFoundation/Base.subproj/ForSwiftFoundationOnly.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
#include <termios.h>
#elif TARGET_OS_WASI
#include <fcntl.h>
// Define _WASI_EMULATED_MMAN here to use the emulated mman functions in
// Foundation-side without requiring transitive clients to define it.
#undef _WASI_EMULATED_MMAN
#define _WASI_EMULATED_MMAN
#include <sys/mman.h>
#elif TARGET_OS_LINUX
#include <errno.h>
#include <features.h>
Expand Down
5 changes: 0 additions & 5 deletions Sources/Foundation/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@
@usableFromInline let memcpy = Musl.memcpy
@usableFromInline let memcmp = Musl.memcmp
#elseif canImport(WASILibc)
#if swift(>=6.0)
private import wasi_emulated_mman
#else
import wasi_emulated_mman
#endif
@usableFromInline let calloc = WASILibc.calloc
@usableFromInline let malloc = WASILibc.malloc
@usableFromInline let free = WASILibc.free
Expand Down
1 change: 0 additions & 1 deletion Sources/Foundation/FileHandle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ fileprivate let _write = Musl.write(_:_:_:)
fileprivate let _close = Musl.close(_:)
#elseif canImport(WASILibc)
import WASILibc
@_implementationOnly import wasi_emulated_mman
fileprivate let _read = WASILibc.read(_:_:_:)
fileprivate let _write = WASILibc.write(_:_:_:)
fileprivate let _close = WASILibc.close(_:)
Expand Down