From 27eed1389b8bece41950c53b47acffb3bb0c83ee Mon Sep 17 00:00:00 2001 From: kwolekr Date: Tue, 27 Oct 2015 01:50:46 -0400 Subject: Move basic, non-numeric macros from util/numeric.h to basicmacros.h --- src/basicmacros.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/basicmacros.h (limited to 'src/basicmacros.h') diff --git a/src/basicmacros.h b/src/basicmacros.h new file mode 100644 index 000000000..2b183d6c5 --- /dev/null +++ b/src/basicmacros.h @@ -0,0 +1,31 @@ +/* +Minetest +Copyright (C) 2010-2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#ifndef BASICMACROS_HEADER +#define BASICMACROS_HEADER + +#define ARRLEN(x) (sizeof(x) / sizeof((x)[0])) + +#define MYMIN(a, b) ((a) < (b) ? (a) : (b)) + +#define MYMAX(a, b) ((a) > (b) ? (a) : (b)) + +#define CONTAINS(c, v) (std::find((c).begin(), (c).end(), (v)) != (c).end()) + +#endif -- cgit v1.2.3