diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-07 21:17:43 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-07 21:17:43 +0000 |
commit | 6adf679c4a4129a932530fc3c8e9f84723278e1f (patch) | |
tree | e2c831645a0122279b528b8fde832b74dd044797 /include | |
parent | efeb7fbc91ab2ac9b476f143babd7fe450c1f796 (diff) |
Merged revisions 209400 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r209400 | kpfleming | 2009-07-28 08:49:46 -0500 (Tue, 28 Jul 2009) | 3 lines
Define side-effect-safe MIN and MAX macros and remove duplicate definitions from various files.
(closes issue #16251)
Reported by: asgaroth
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@238499 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/utils.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h index fcbbdbd39..91de914b5 100644 --- a/include/asterisk/utils.h +++ b/include/asterisk/utils.h @@ -220,6 +220,11 @@ void ast_sha1_hash(char *output, char *input); int ast_base64encode_full(char *dst, const unsigned char *src, int srclen, int max, int linebreaks); +#undef MIN +#define MIN(a, b) ({ typeof(a) __a = (a); typeof(b) __b = (b); ((__a > __b) ? __b : __a);}) +#undef MAX +#define MAX(a, b) ({ typeof(a) __a = (a); typeof(b) __b = (b); ((__a < __b) ? __b : __a);}) + /*! * \brief Encode data in base64 * \param dst the destination buffer |