aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2006-04-08 12:41:02 +0000
committerMax Horn2006-04-08 12:41:02 +0000
commit453e69b6c2156ec8e84ff99a4f0fa3841362c06a (patch)
treeaf19202c056c7dbdccb61f71d249e7a7bbaaf4bb /common
parent4a8c9c323d7914c3ad33c884ecf9e0cb73ee2db5 (diff)
downloadscummvm-rg350-453e69b6c2156ec8e84ff99a4f0fa3841362c06a.tar.gz
scummvm-rg350-453e69b6c2156ec8e84ff99a4f0fa3841362c06a.tar.bz2
scummvm-rg350-453e69b6c2156ec8e84ff99a4f0fa3841362c06a.zip
Change check for MIN/MAX macros: Always undef those so that our templates are used (which are safer, consider MIN(a++, b++))
svn-id: r21692
Diffstat (limited to 'common')
-rw-r--r--common/util.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/common/util.h b/common/util.h
index 79dbba6451..198fcd61ef 100644
--- a/common/util.h
+++ b/common/util.h
@@ -26,18 +26,17 @@
#include "common/str.h"
#include "common/array.h"
-#if defined (__INNOTEK_LIBC__) || (defined (__amigaos4__) && defined(__NEWLIB__))
+#ifdef MIN
#undef MIN
+#endif
+
+#ifdef MAX
#undef MAX
#endif
template<typename T> inline T ABS (T x) { return (x>=0) ? x : -x; }
-#if !defined(MIN)
template<typename T> inline T MIN (T a, T b) { return (a<b) ? a : b; }
-#endif
-#if !defined(MAX)
template<typename T> inline T MAX (T a, T b) { return (a>b) ? a : b; }
-#endif
/**
* Template method which swaps the vaulues of its two parameters.