From 5ed9e786761958a8cb8f48888108ce6ae6818683 Mon Sep 17 00:00:00 2001 From: Evan Pezent Date: Tue, 7 Sep 2021 20:20:12 -0700 Subject: [PATCH] add #include fallback --- implot_items.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/implot_items.cpp b/implot_items.cpp index aa4b044..90f3705 100644 --- a/implot_items.cpp +++ b/implot_items.cpp @@ -51,9 +51,12 @@ #endif #if defined __SSE__ || defined __x86_64__ || defined _M_X64 -static IMPLOT_INLINE float ImInvSqrt(float x) { return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(x))); } +#ifndef IMGUI_ENABLE_SSE +#include +#endif +static IMPLOT_INLINE float ImInvSqrt(float x) { return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(x))); } #else -static IMPLOT_INLINE float ImInvSqrt(float x) { return 1.0f / sqrtf(x); } +static IMPLOT_INLINE float ImInvSqrt(float x) { return 1.0f / sqrtf(x); } #endif #define IMPLOT_NORMALIZE2F_OVER_ZERO(VX,VY) do { float d2 = VX*VX + VY*VY; if (d2 > 0.0f) { float inv_len = ImInvSqrt(d2); VX *= inv_len; VY *= inv_len; } } while (0)