diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2009-07-28 13:49:46 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2009-07-28 13:49:46 +0000 |
commit | ba020fc3909c1b241358d789be991c039452749c (patch) | |
tree | 0325381f58fd6b2bc0bddffcc3e553dbd4f8ad8e /include | |
parent | b3090ee28a707aea02ec0dc1adc72dab66f17431 (diff) |
Define side-effect-safe MIN and MAX macros and remove duplicate definitions from various files.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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 6f9684409..051748510 100644 --- a/include/asterisk/utils.h +++ b/include/asterisk/utils.h @@ -222,6 +222,11 @@ void ast_sha1_hash(char *output, const 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 |