From b4120d6993a702d018ca02080644da3c650375cd Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Fri, 22 Aug 2014 12:21:39 +0000 Subject: [PATCH] math: fix 32-bit builds. --- src/lol/math/arraynd.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lol/math/arraynd.h b/src/lol/math/arraynd.h index d0bb7377..50817a5a 100644 --- a/src/lol/math/arraynd.h +++ b/src/lol/math/arraynd.h @@ -107,11 +107,13 @@ public: { } +#if PTRDIFF_MAX > INT_MAX inline arraynd(vec_t sizes, element_t e = element_t()) : m_sizes(sizes) { FixSizes(e); } +#endif inline arraynd(vec_t sizes, element_t e = element_t()) { @@ -136,6 +138,7 @@ public: } /* Access elements directly using an vec_t index */ +#if PTRDIFF_MAX > INT_MAX inline element_t const & operator[](vec_t const &pos) const { ptrdiff_t n = pos[N - 1]; @@ -149,6 +152,7 @@ public: return const_cast( const_cast const&>(*this)[pos]); } +#endif /* Access elements directly using an ivec2, ivec3 etc. index */ inline element_t const & operator[](vec_t const &pos) const @@ -229,11 +233,13 @@ public: /* Resize the array. * FIXME: data gets scrambled; should we care? */ +#if PTRDIFF_MAX > INT_MAX inline void SetSize(vec_t sizes, element_t e = element_t()) { m_sizes = sizes; FixSizes(e); } +#endif inline void SetSize(vec_t sizes, element_t e = element_t()) {