From 976afdac3d7830f95ad53d4f2de0029d28c94aaf Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Sat, 14 Sep 2024 13:14:36 +0200 Subject: [PATCH] fixing windows build --- runtime/Includes/Maths/Angles.inl | 2 -- runtime/Includes/PreCompiled.h | 12 ++++++------ runtime/Includes/Utils/AntiWindows.h | 5 +++++ runtime/Includes/Utils/AntiX11.h | 5 +++++ 4 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 runtime/Includes/Utils/AntiWindows.h create mode 100644 runtime/Includes/Utils/AntiX11.h diff --git a/runtime/Includes/Maths/Angles.inl b/runtime/Includes/Maths/Angles.inl index 55091d0..df460ff 100644 --- a/runtime/Includes/Maths/Angles.inl +++ b/runtime/Includes/Maths/Angles.inl @@ -153,8 +153,6 @@ namespace mlx { double s, c; ::sincos(x, &s, &c); - - *sin = static_cast(s); *cos = static_cast(c); } diff --git a/runtime/Includes/PreCompiled.h b/runtime/Includes/PreCompiled.h index 02c724f..71dfc71 100644 --- a/runtime/Includes/PreCompiled.h +++ b/runtime/Includes/PreCompiled.h @@ -3,8 +3,6 @@ #define VK_NO_PROTOTYPES -#define Window X11Window // f*ck X11 - #include #include #include @@ -14,9 +12,6 @@ #include #include -#include -#include - #include #include #include @@ -47,6 +42,7 @@ #include #include #include + #if defined(MLX_PLAT_LINUX) #include // sincos #endif @@ -69,7 +65,11 @@ #include #endif -#undef Window +#include +#include + +#include +#include #include #include diff --git a/runtime/Includes/Utils/AntiWindows.h b/runtime/Includes/Utils/AntiWindows.h new file mode 100644 index 0000000..a7e1b45 --- /dev/null +++ b/runtime/Includes/Utils/AntiWindows.h @@ -0,0 +1,5 @@ +#undef CreateWindow +#undef GetEnvironmentVariable +#undef GetSystemDirectory +#undef MemoryBarrier +#undef RemoveDirectory diff --git a/runtime/Includes/Utils/AntiX11.h b/runtime/Includes/Utils/AntiX11.h new file mode 100644 index 0000000..2068855 --- /dev/null +++ b/runtime/Includes/Utils/AntiX11.h @@ -0,0 +1,5 @@ +#undef Always +#undef Bool +#undef False +#undef None +#undef True