summaryrefslogtreecommitdiff
path: root/src/util/numeric.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/numeric.h')
-rw-r--r--src/util/numeric.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util/numeric.h b/src/util/numeric.h
index 8e3a617ff..ee8fea8cf 100644
--- a/src/util/numeric.h
+++ b/src/util/numeric.h
@@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "../irr_v3d.h"
#include "../irr_aabb3d.h"
#include <list>
+#include <algorithm>
// Calculate the borders of a "d-radius" cube
void getFacePositions(std::list<v3s16> &list, u16 d);
@@ -139,6 +140,9 @@ inline v3s16 arealim(v3s16 p, s16 d)
return p;
}
+#define ARRLEN(x) (sizeof(x) / sizeof((x)[0]))
+#define CONTAINS(c, v) (std::find((c).begin(), (c).end(), (v)) != (c).end())
+
// The naive swap performs better than the xor version
#define SWAP(t, x, y) do { \
t temp = x; \