Import tgmath_h instead of Darwin.C.tgmath

Recent Apple SDKs moved tgmath.h from Darwin.C.tgmath to tgmath_h.

rdar://135982993
This commit is contained in:
Ian Anderson
2024-09-13 17:56:44 -07:00
parent 626e5118d1
commit 488c47b6be
3 changed files with 12 additions and 4 deletions

View File

@@ -15,7 +15,11 @@
import Swift
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(visionOS)
import Darwin.C.tgmath
#if canImport(tgmath_h)
import tgmath_h
#else
import Darwin.C.tgmath
#endif
#elseif canImport(Musl)
import Musl
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Cygwin) || os(Haiku)

View File

@@ -1,7 +1,9 @@
// RUN: %target-run-simple-swiftgyb(-Xfrontend -enable-experimental-forward-mode-differentiation)
// REQUIRES: executable_test
#if canImport(Darwin)
#if canImport(tgmath_h)
import tgmath_h
#elseif canImport(Darwin)
import Darwin.C.tgmath
#elseif canImport(Glibc)
import Glibc

View File

@@ -19,8 +19,10 @@
// REQUIRES: rdar94452524
#if canImport(Darwin)
import Darwin.C.tgmath
#if canImport(tgmath_h)
import tgmath_h
#elseif canImport(Darwin)
import tgmath_h
#elseif canImport(Glibc)
import Glibc
#elseif os(WASI)