aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-07 21:17:03 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-07 21:17:03 +0000
commitc0f41df0a00631fb204617f75cb1dc5447c814f1 (patch)
treea11f690941fd89fbe72b076a18eca91fcead5f50 /include/asterisk
parent91442293719fefd7639e06bc97a8e31212dd473c (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.0@238494 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/utils.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index e3297b0ec..4ffe8d07c 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