Skip to content

Commit af6d9e3

Browse files
committed
Shims: use _hypotf on Windows rather than __builtin_hypot
Unfortunately, `hypotf` is an inline in MSVCRT which forwards to `_hypotf`. This repairs the Windows build.
1 parent b3a2e40 commit af6d9e3

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)