Stolen from the Linux kernel. Signed-off-by: Juergen Beisert <jbe@xxxxxxxxxxxxxx> --- include/common.h | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/include/common.h b/include/common.h index 1bea10c..35ad7b9 100644 --- a/include/common.h +++ b/include/common.h @@ -231,4 +231,14 @@ extern const char version_string[]; } \ ) +#define abs(x) ({ \ + long __x = (x); \ + (__x < 0) ? -__x : __x; \ + }) + +#define abs64(x) ({ \ + s64 __x = (x); \ + (__x < 0) ? -__x : __x; \ + }) + #endif /* __COMMON_H_ */ -- 1.7.2.3 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox