diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/Compat.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/Compat.h b/include/Compat.h index 712ff1373..d69a9a2c1 100644 --- a/include/Compat.h +++ b/include/Compat.h @@ -6,6 +6,7 @@ #ifdef __cplusplus +#include <cmath> #include <cstddef> #include <memory> #include <type_traits> @@ -13,6 +14,18 @@ namespace Sci { +// std::round (not present on older MacOSX SDKs) +template<class T> +T round(T arg) { + return round(arg); +} + +// std::lround (not present on older MacOSX SDKs) +template<class T> +long lround(T arg) { + return lround(arg); +} + // std::make_unique template<class T> struct _Unique_if { typedef std::unique_ptr<T> _Single_object; @@ -37,7 +50,7 @@ template<class T> template<class T, class... Args> typename _Unique_if<T>::_Known_bound make_unique(Args&&...) = delete; - + // std::size template <typename T, size_t N> constexpr size_t size(const T (&)[N]) noexcept { @@ -48,4 +61,4 @@ constexpr size_t size(const T (&)[N]) noexcept { #endif -#endif
\ No newline at end of file +#endif |
