From basile at opensource.dyc.edu Tue Apr 28 13:42:42 2015 From: basile at opensource.dyc.edu (Anthony G. Basile) Date: Tue, 28 Apr 2015 15:42:42 -0400 Subject: [nas] [PATCH] server/include/misc.h: remove macros for abs() and fabs() Message-ID: <1430250162-30699-1-git-send-email-basile@opensource.dyc.edu> From: "Anthony G. Basile" On a uClibc system, the macro definitions of abs() and fabs() cause the build to fail. Since these are specified by POSIX, it is safe to just drop their definition. This has been tested on uClibc, glibc and musl. Signed-off-by: Anthony G. Basile --- server/include/misc.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/server/include/misc.h b/server/include/misc.h index 2267ae0..fb904c8 100644 --- a/server/include/misc.h +++ b/server/include/misc.h @@ -71,12 +71,6 @@ typedef int Bool; #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b)) -#ifndef abs -#define abs(a) ((a) > 0 ? (a) : -(a)) -#endif -#ifndef fabs -#define fabs(a) ((a) > 0.0 ? (a) : -(a)) /* floating absolute value */ -#endif #define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0)) /* this assumes b > 0 */ #define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b) -- 2.0.5 From jon at radscan.com Tue Apr 28 18:57:24 2015 From: jon at radscan.com (Jon Trulson) Date: Tue, 28 Apr 2015 18:57:24 -0600 (MDT) Subject: [nas] [PATCH] server/include/misc.h: remove macros for abs() and fabs() In-Reply-To: <1430250162-30699-1-git-send-email-basile@opensource.dyc.edu> References: <1430250162-30699-1-git-send-email-basile@opensource.dyc.edu> Message-ID: On Tue, 28 Apr 2015, Anthony G. Basile wrote: > From: "Anthony G. Basile" > > On a uClibc system, the macro definitions of abs() and fabs() > cause the build to fail. Since these are specified by POSIX, > it is safe to just drop their definition. This has been tested > on uClibc, glibc and musl. > > Signed-off-by: Anthony G. Basile Thanks! Applied. [...] -- Jon Trulson "Don't believe everything you read on the internet." --Abraham Lincoln