From 8191191fffc592d999b7c08e29d3e414de4d332c Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Sat, 14 Sep 2024 13:04:43 +0200 Subject: [PATCH] fixing macos and windows CI ? x3 --- runtime/Includes/Maths/Angles.inl | 46 +++++++++++++++++++------------ runtime/Includes/PreCompiled.h | 2 +- xmake.lua | 2 +- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/runtime/Includes/Maths/Angles.inl b/runtime/Includes/Maths/Angles.inl index 7b1cceb..55091d0 100644 --- a/runtime/Includes/Maths/Angles.inl +++ b/runtime/Includes/Maths/Angles.inl @@ -147,27 +147,37 @@ namespace mlx } }; - template - void SinCos(T x, T* sin, T* cos) - { - double s, c; - ::sincos(x, &s, &c); + #ifdef MLX_PLAT_LINUX + template + void SinCos(T x, T* sin, T* cos) + { + double s, c; + ::sincos(x, &s, &c); - *sin = static_cast(s); - *cos = static_cast(c); - } - template<> - inline void SinCos(float x, float* s, float* c) - { - ::sincosf(x, s, c); - } + *sin = static_cast(s); + *cos = static_cast(c); + } - template<> - inline void SinCos(long double x, long double* s, long double* c) - { - ::sincosl(x, s, c); - } + template<> + inline void SinCos(float x, float* s, float* c) + { + ::sincosf(x, s, c); + } + + template<> + inline void SinCos(long double x, long double* s, long double* c) + { + ::sincosl(x, s, c); + } + #else + template + void SinCos(T x, T* sin, T* cos) + { + *sin = std::sin(x); + *cos = std::cos(x); + } + #endif } template diff --git a/runtime/Includes/PreCompiled.h b/runtime/Includes/PreCompiled.h index 35311db..02c724f 100644 --- a/runtime/Includes/PreCompiled.h +++ b/runtime/Includes/PreCompiled.h @@ -47,7 +47,7 @@ #include #include #include -#if defined(MLX_PLAT_MACOS) || defined(MLX_PLAT_LINUX) || defined(MLX_PLAT_UNIX) +#if defined(MLX_PLAT_LINUX) #include // sincos #endif diff --git a/xmake.lua b/xmake.lua index 135f6b8..59e4fe5 100644 --- a/xmake.lua +++ b/xmake.lua @@ -50,7 +50,7 @@ target("mlx") add_options("force_wayland") add_includedirs("runtime/Includes", "runtime/Sources", "includes", "third_party") - set_pcxxheader("runtime/Sources/PreCompiled.h") + set_pcxxheader("runtime/Includes/PreCompiled.h") add_defines("MLX_BUILD", "SDL_MAIN_HANDLED")