Skip to content

Commit 7961e8d

Browse files
Merge pull request #76471 from ian-twilightcoder/tgmath_fix
Import tgmath_h instead of Darwin.C.tgmath
2 parents 0bd4e4e + 488c47b commit 7961e8d

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

stdlib/public/Differentiation/TgmathDerivatives.swift.gyb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
import Swift
1616

1717
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(visionOS)
18-
import Darwin.C.tgmath
18+
#if canImport(tgmath_h)
19+
import tgmath_h
20+
#else
21+
import Darwin.C.tgmath
22+
#endif
1923
#elseif canImport(Musl)
2024
import Musl
2125
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Cygwin) || os(Haiku)

test/AutoDiff/stdlib/tgmath_derivatives.swift.gyb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// RUN: %target-run-simple-swiftgyb(-Xfrontend -enable-experimental-forward-mode-differentiation)
22
// REQUIRES: executable_test
33

4-
#if canImport(Darwin)
4+
#if canImport(tgmath_h)
5+
import tgmath_h
6+
#elseif canImport(Darwin)
57
import Darwin.C.tgmath
68
#elseif canImport(Glibc)
79
import Glibc

test/stdlib/tgmath.swift.gyb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919

2020
// REQUIRES: rdar94452524
2121

22-
#if canImport(Darwin)
23-
import Darwin.C.tgmath
22+
#if canImport(tgmath_h)
23+
import tgmath_h
24+
#elseif canImport(Darwin)
25+
import tgmath_h
2426
#elseif canImport(Glibc)
2527
import Glibc
2628
#elseif os(WASI)

0 commit comments

Comments
 (0)