Skip to content

Commit 600d90d

Browse files
committed
Platform: alias math constants on Windows
The non-C/C++ standard defined math constants require `-Xcc -D_USE_MATH_DEFINES` when using the `ucrt` module. Instead, provide them through the wrapper `MSVCRT` module as aliases so that the user does not need to be aware of this in practice. Repairs the Windows build of `_Differentiation`.
1 parent 0366e61 commit 600d90d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

stdlib/public/Platform/msvcrt.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,6 @@ public let DBL_MIN = Double.leastNormalMagnitude
8484
@available(swift, deprecated: 3.0, message: "Please use 'Double.leastNonzeroMagnitude' or '.leastNonzeroMagnitude'.")
8585
public let DBL_TRUE_MIN = Double.leastNonzeroMagnitude
8686

87+
public let M_LN2 = ucrt.M_LN2
88+
public let M_LOG10E = ucrt.M_LOG10E
89+
public let M_2_SQRTPI = ucrt.M_2_SQRTPI

0 commit comments

Comments
 (0)