Skip to content

Commit

Permalink
Merge pull request #4913 from kateinoigakukun/pr-f6022e0721b057fdae9a…
Browse files Browse the repository at this point in the history
…44e9299afba97392ce2d
  • Loading branch information
kateinoigakukun committed Mar 9, 2024
2 parents f7d3cde + 90c1832 commit f997707
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CoreFoundation/Base.subproj/ForSwiftFoundationOnly.h
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
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
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

0 comments on commit f997707

Please sign in to comment.