From c697ddd42e134db7e955bd3e2591562b4fdbecf9 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 4 Apr 2019 08:55:36 -0700 Subject: [PATCH] Shims: include `math.h` on Windows Since we use `_hypotf` on Windows rather than `__builtin_hyptof` due to a bug in LLVM with the TLI lowering to the wrong builtin, include the math header to get the proper declaration. --- stdlib/public/SwiftShims/LibcShims.h | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/public/SwiftShims/LibcShims.h b/stdlib/public/SwiftShims/LibcShims.h index 7a846dfad7cdb..89efa8cc44ed2 100644 --- a/stdlib/public/SwiftShims/LibcShims.h +++ b/stdlib/public/SwiftShims/LibcShims.h @@ -214,6 +214,7 @@ float _swift_stdlib_log1pf(float x) { static inline SWIFT_ALWAYS_INLINE float _swift_stdlib_hypotf(float x, float y) { #if defined(_WIN32) + extern float _hypotf(float, float); return _hypotf(x, y); #else return __builtin_hypotf(x, y);