From bfe91c1098a843c15fb8a75e1b85a41311db1f41 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 22 Jan 2015 17:49:44 +0000 Subject: [PATCH] math: make sure PTRDIFF_MAX and INT_MAX are defined before using them. --- src/lol/math/arraynd.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lol/math/arraynd.h b/src/lol/math/arraynd.h index a73a9783..7898448f 100644 --- a/src/lol/math/arraynd.h +++ b/src/lol/math/arraynd.h @@ -26,12 +26,13 @@ #include #include +#include +#include #include namespace lol { - template class arraynd_initializer { @@ -275,5 +276,9 @@ private: template using array2d = arraynd<2, T...>; template using array3d = arraynd<3, T...>; +/* Make sure these macros exist since we use them in preprocessor tests. */ +static_assert(PTRDIFF_MAX > 0, "missing PTRDIFF_MAX"); +static_assert(INT_MAX > 0, "missing INT_MAX"); + } /* namespace lol */