Skip to content

Import tgmath_h instead of Darwin.C.tgmath #76471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion stdlib/public/Differentiation/TgmathDerivatives.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion test/AutoDiff/stdlib/tgmath_derivatives.swift.gyb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions test/stdlib/tgmath.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down