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
This commit is contained in:
Max Horn 2006-04-08 12:41:02 +00:00
parent 4a8c9c323d
commit 453e69b6c2

View File

@ -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.