From 70ba6dd6d181b672203681c62a9a809d8a5fb3d5 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sat, 5 Sep 2015 11:42:41 +0200 Subject: [PATCH] src/aubio_priv.h: protect SQR parameters, avoid redefining MIN/MAX --- src/aubio_priv.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/aubio_priv.h b/src/aubio_priv.h index 69f88e73..83d36989 100644 --- a/src/aubio_priv.h +++ b/src/aubio_priv.h @@ -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; } -- 2.11.0