fixed abs() impelmentation

git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1854 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Li-Ta Lo 2005-01-11 16:33:31 +00:00
parent 8b0356c2c9
commit 5ce1590355
1 changed files with 10 additions and 1 deletions

View File

@ -99,7 +99,16 @@
#define PRIM_OPS_NO_REDEFINE_ASM #define PRIM_OPS_NO_REDEFINE_ASM
#include "x86emui.h" #include "x86emui.h"
#define abs(x) (x ? x>0: -x)
#define abs(x) ({ \
int __x = (x); \
(__x < 0) ? -__x : __x; \
})
#define labs(x) ({ \
long __x = (x); \
(__x < 0) ? -__x : __x; \
})
/*------------------------- Global Variables ------------------------------*/ /*------------------------- Global Variables ------------------------------*/