Skip to content

Commit f8d9b52

Browse files
committed
another attempt at fixing the float16 ABI break
1 parent 7a4bd46 commit f8d9b52

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

stdlib/public/core/FloatingPointToString.swift

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,24 @@
124124
//
125125
// ================================================================
126126

127-
// Float16 is not currently supported on Intel macOS.
128-
// (This will change once there's a fully-stable Float16
129-
// ABI on that platform.)
130-
#if !((os(macOS) || targetEnvironment(macCatalyst)) && arch(x86_64))
127+
#if (os(macOS) || targetEnvironment(macCatalyst)) && arch(x86_64)
128+
129+
// Float16 is not currently supported on Intel x86_64 macOS,
130+
// (including macCatalyst on x86_64) but this symbol somehow got
131+
// exported there.
132+
// This preserves the export.
133+
@available(SwiftStdlib 5.3, *)
134+
@_silgen_name("swift_float16ToString")
135+
public func _float16ToStringImpl(
136+
_ textBuffer: UnsafeMutablePointer<UTF8.CodeUnit>,
137+
_ bufferLength: UInt,
138+
_ value: Float,
139+
_ debug: Bool
140+
) -> UInt64 {
141+
fatalError()
142+
}
143+
144+
#else
131145

132146
// Support Legacy ABI on top of new implementation
133147
@available(SwiftStdlib 5.3, *)

0 commit comments

Comments
 (0)