Skip to content

Commit 2d7fedd

Browse files
authored
Merge pull request #23780 from compnerd/math-is-terrible
Shims: use `_hypotf` on Windows rather than `__builtin_hypot`
2 parents 0205150 + af6d9e3 commit 2d7fedd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/public/SwiftShims/LibcShims.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ float _swift_stdlib_log1pf(float x) {
213213

214214
static inline SWIFT_ALWAYS_INLINE
215215
float _swift_stdlib_hypotf(float x, float y) {
216+
#if defined(_WIN32)
217+
return _hypotf(x, y);
218+
#else
216219
return __builtin_hypotf(x, y);
220+
#endif
217221
}
218222

219223
static inline SWIFT_ALWAYS_INLINE

0 commit comments

Comments
 (0)