Skip to content

Commit

Permalink
xsimd_scalar.hpp: fix for missing exp10 on macOS < 10.9
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 authored and serge-sans-paille committed Dec 20, 2023
1 parent c1247bf commit a48ab43
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion include/xsimd/arch/xsimd_scalar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#include "xtl/xcomplex.hpp"
#endif

#ifdef __APPLE__
#include <AvailabilityMacros.h>
#endif

namespace xsimd
{
template <class T, class A>
Expand Down Expand Up @@ -502,7 +506,7 @@ namespace xsimd
return !(x0 == x1);
}

#if defined(__APPLE__)
#if defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED > 1080)
inline float exp10(const float& x) noexcept
{
return __exp10f(x);
Expand All @@ -520,6 +524,15 @@ namespace xsimd
{
return ::exp10(x);
}
#elif !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 5)
inline float exp10(const float& x) noexcept
{
return __builtin_exp10f(x);
}
inline double exp10(const double& x) noexcept
{
return __builtin_exp10(x);
}
#elif defined(_WIN32)
template <class T, class = typename std::enable_if<std::is_scalar<T>::value>::type>
inline T exp10(const T& x) noexcept
Expand Down

0 comments on commit a48ab43

Please sign in to comment.