From: Martin Mares Date: Tue, 27 Mar 2001 10:52:48 +0000 (+0000) Subject: Added ABS macro. X-Git-Tag: holmes-import~1502 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=b53b0576a2325cd6b81625a3b9ad3f91f0b7a249;p=libucw.git Added ABS macro. --- diff --git a/lib/lib.h b/lib/lib.h index 05bde59e..0fe45010 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -30,6 +30,7 @@ #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) #define CLAMP(x,min,max) ({ int _t=x; (_t < min) ? min : (_t > max) ? max : _t; }) +#define ABS(x) ((x) < 0 ? -(x) : (x)) #define ARRAY_SIZE(a) (sizeof(a)/sizeof(*(a))) /* Temporary Files */