Browse Source

[libc] Add abs()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 years ago
parent
commit
26f782bb41
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/include/stdlib.h

+ 4
- 0
src/include/stdlib.h View File

@@ -93,6 +93,10 @@ static inline void srand ( unsigned int seed ) {
93 93
  ****************************************************************************
94 94
  */
95 95
 
96
+static inline __attribute__ (( always_inline )) int abs ( int value ) {
97
+	return __builtin_abs ( value );
98
+}
99
+
96 100
 extern int system ( const char *command );
97 101
 extern __asmcall int main ( void );
98 102
 

Loading…
Cancel
Save