shithub: aubio

Download patch

ref: 70ba6dd6d181b672203681c62a9a809d8a5fb3d5
parent: cc81763bbaa1fc36144a5bdd8f0e3107aed22e25
author: Paul Brossier <piem@piem.org>
date: Sat Sep 5 07:42:41 EDT 2015

src/aubio_priv.h: protect SQR parameters, avoid redefining MIN/MAX

--- a/src/aubio_priv.h
+++ b/src/aubio_priv.h
@@ -196,10 +196,14 @@
 /* handy shortcuts */
 #define DB2LIN(g) (POW(10.0,(g)*0.05f))
 #define LIN2DB(v) (20.0*LOG10(v))
-#define SQR(_a)   (_a*_a)
+#define SQR(_a)   ((_a)*(_a))
 
-#define MAX(a,b)  ( a > b ? a : b)
-#define MIN(a,b)  ( a < b ? a : b)
+#ifndef MAX
+#define MAX(a,b)  (((a)>(b))?(a):(b))
+#endif /* MAX */
+#ifndef MIN
+#define MIN(a,b)  (((a)<(b))?(a):(b))
+#endif /* MIN */
 
 #define ELEM_SWAP(a,b) { register smpl_t t=(a);(a)=(b);(b)=t; }