src/aubio_priv.h: protect SQR parameters, avoid redefining MIN/MAX
authorPaul Brossier <piem@piem.org>
Sat, 5 Sep 2015 09:42:41 +0000 (11:42 +0200)
committerPaul Brossier <piem@piem.org>
Sat, 5 Sep 2015 09:42:41 +0000 (11:42 +0200)
src/aubio_priv.h

index 69f88e7..83d3698 100644 (file)
@@ -196,10 +196,14 @@ typedef enum {
 /* handy shortcuts */
 #define DB2LIN(g) (POW(10.0,(g)*0.05f))
 #define LIN2DB(v) (20.0*LOG10(v))
-#define SQR(_a)   (_a*_a)
-
-#define MAX(a,b)  ( a > b ? a : b)
-#define MIN(a,b)  ( a < b ? a : b)
+#define SQR(_a)   ((_a)*(_a))
+
+#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; }