Skip to content

Commit 1f2007e

Browse files
authored
Merge pull request #110 from lorentey/there-is-no-such-thing-as-an-implementation-only-import
[native] Stop using @_implementationOnly import in package configs
2 parents ddacb08 + 074c8c8 commit 1f2007e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Sources/Atomics/Unmanaged extensions.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,17 @@ internal func _sa_retain_n(_ object: UnsafeMutableRawPointer, _ delta: UInt32)
1616

1717
@_silgen_name("_sa_release_n")
1818
internal func _sa_release_n(_ object: UnsafeMutableRawPointer, _ delta: UInt32)
19-
#elseif ATOMICS_NATIVE_BUILTINS
20-
@_implementationOnly import _AtomicsShims
2119
#else
20+
// Note: with ATOMICS_NATIVE_BUILTINS, this file contains the last remaining
21+
// import of the shims module, and we only need it to get the declarations for
22+
// _sa_retain_n/_sa_release_n. The import is unfortunately still problematic;
23+
// these functions need to be moved into the stdlib or (preferably) we need
24+
// a compiler-level fix for https://github.com/apple/swift/issues/56105 to get rid
25+
// of it.
26+
//
27+
// Hiding the import using @_implementationOnly is not possible unless
28+
// Swift's library evolution dialect is enabled. (Which we cannot easily test
29+
// here.) Perhaps `internal import` will help work around this at some point.
2230
import _AtomicsShims
2331
#endif
2432

0 commit comments

Comments
 (0)