Skip to content

Commit

Permalink
Merge pull request #2921 from scentini/import-glibc
Browse files Browse the repository at this point in the history
Explicitly import Glibc in files that rely on it
  • Loading branch information
compnerd committed Nov 18, 2020
2 parents 3d5f197 + 830d22f commit 5b9797f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Foundation/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ internal func malloc_good_size(_ size: Int) -> Int {

@_implementationOnly import CoreFoundation

#if canImport(Glibc)
import Glibc
#endif

internal func __NSDataInvokeDeallocatorUnmap(_ mem: UnsafeMutableRawPointer, _ length: Int) {
#if os(Windows)
UnmapViewOfFile(mem)
Expand Down
5 changes: 5 additions & 0 deletions Sources/Foundation/NSLock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
//

@_implementationOnly import CoreFoundation

#if canImport(Glibc)
import Glibc
#endif

#if os(Windows)
import WinSDK
#endif
Expand Down
4 changes: 4 additions & 0 deletions Sources/Foundation/Thread.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

@_implementationOnly import CoreFoundation

#if canImport(Glibc)
import Glibc
#endif

// WORKAROUND_SR9811
#if os(Windows)
internal typealias _swift_CFThreadRef = HANDLE
Expand Down

0 comments on commit 5b9797f

Please sign in to comment.