From e7e51166f562cae99d50e2f8d677f58ee01a79f0 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Wed, 11 Apr 2012 14:09:57 +0200 Subject: [PATCH] wrap define of ABS in ifndef in std.h --- sw/include/std.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sw/include/std.h b/sw/include/std.h index 3def069a3e..e99084da02 100644 --- a/sw/include/std.h +++ b/sw/include/std.h @@ -86,7 +86,9 @@ typedef uint8_t unit_t; #define Min(x,y) (x < y ? x : y) #define Max(x,y) (x > y ? x : y) +#ifndef ABS #define ABS(val) ((val) < 0 ? -(val) : (val)) +#endif #define Bound(_x, _min, _max) { if (_x > _max) _x = _max; else if (_x < _min) _x = _min; } #define BoundAbs(_x, _max) Bound(_x, -(_max), (_max))