From 26f782bb41c5d4fce427e23aba3199c0fb4297d8 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 7 Jan 2014 03:53:56 +0000 Subject: [PATCH] [libc] Add abs() Signed-off-by: Michael Brown --- src/include/stdlib.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/include/stdlib.h b/src/include/stdlib.h index bca85a234..2951522b8 100644 --- a/src/include/stdlib.h +++ b/src/include/stdlib.h @@ -93,6 +93,10 @@ static inline void srand ( unsigned int seed ) { **************************************************************************** */ +static inline __attribute__ (( always_inline )) int abs ( int value ) { + return __builtin_abs ( value ); +} + extern int system ( const char *command ); extern __asmcall int main ( void );