aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-07 21:17:32 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-07 21:17:32 +0000
commitc832cd33eec470d8f013ac466e15e5624220c572 (patch)
tree755371d7c5972165854b3f322ccd09f1a7ce2abb /include
parent670c39ec0622afe0888d0c54f39b3319a2cbf691 (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.1@238497 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-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 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